“We need to at least teach people that there’s a dark side to the idea that you should move fast and break things,” said Laura Norén, a postdoctoral fellow at the Center for Data Science at New York University who began teaching a new data science ethics course this semester. “You can patch the software, but you can’t patch a person if you, you know, damage someone’s reputation.”

Computer science programs are required to make sure students have an understanding of ethical issues related to computing in order to be accredited by ABET, a global accreditation group for university science and engineering programs. Some computer science departments have folded the topic into a broader class, and others have stand-alone courses.

But until recently, ethics did not seem relevant to many students.

“Compared to transportation or doctors, your daily interaction with physical harm or death or pain is a lot less if you are writing software for apps,” said Joi Ito, director of the M.I.T. Media Lab.

One reason that universities are pushing tech ethics now is the popularization of powerful tools like machine learning — computer algorithms that can autonomously learn tasks by analyzing large amounts of data. Because such tools could ultimately alter human society, universities are rushing to help students understand the potential consequences, said Mr. Ito, who is co-teaching the Harvard-M.I.T. ethics course.

“As we start to see things, like autonomous vehicles, that clearly have the ability to save people but also cause harm, I think that people are scrambling to build a system of ethics,” he said. (Mr. Ito is a director of The New York Times Company.)

Last fall, Cornell University introduced a data science course where students learned to deal with ethical challenges — such as biased data sets that include too few lower-income households to be representative of the general population. Students also debated the use of algorithms to help automate life-changing decisions like hiring or college admissions.