From the 18th century up to the late 20th century, doctors and scientists were repeatedly responsible for numerous inhumane acts carried out on both humans and animals in the name of science.  
This does not discredit science as a body of knowledge and method of investigation, but it is a reminder that the special privileges and authority  enjoyed by scientists are easily abused and require external restraint. 
In the 19th and 20th centuries scientists were responsible for racist social and political policies.        Nazi medical atrocities prompted formulation of the ‘Nuremberg Code’, intended to restrain scientists and doctors.
However, atrocities in the name of science continued despite the Code, which was disregarded by many medical scientists,    and it became clear researchers could not be trusted to act humanely without coercion by the state. The Code has had little impact in practice.  
The Authority of Science
A 1961 experiment proved the average person will obey an authority figure even to the extent of inflicting extreme physical pain and risk of death. The experiment also proved people are conditioned to obey scientists even if ordered to act inhumanely. 
Some scientists have acknowledged the role of science in past atrocities. Others have warned against characterizing scientific atrocities as mere ‘pseudo-science’ unconnected to genuine scientific research, or as the acts of the mentally unstable.  
 ‘ln fact, history is littered with examples of human abuse in the name of ‘science’.’, Cardwell & Flanagan, ‘Psychology AS: The Complete Companion’, p. 189 (2005).
 ‘”In the name of science,” innumerable animals have been vivisected, decerebrated, and tortured in order to produce “objective” data.’, Stenbers, ‘The Invention of Modern Science’, p. 22.3 (2000).
 Shannon, ‘Bioethics’, (4th ed. 1993), Annas & Grodin, ‘he Nazi Doctors and the Nuremberg Code: Human Rights in Human Experimentation’ (1995), Hornblum, ‘Acres of Skin: Human Experiments at Holmesburg Prison‘ (1999), Moreno, ‘Undue Risk: Secret State Experiments on Humans‘ (2000), Guerrini, ‘Experimenting With Humans and Animals: From Galen to animal rights’ (2003), Weyers, ‘The Abuse of Man: An illustrated history of dubious medical experimentation’ (2003), Goliszek, ‘In the Name of Science: A History of Secret Programs, Medical Research, and Human Experimentation’ (2003), Washington, ‘Medical Apartheid: The Dark History of Medical Experimentation on Black Americans from Colonial Times to the Present ‘ (2008), Cina & Perper, ‘When Doctors Kill’ (2010), Chadwick, Have & Meslin, ‘The SAGE Handbook of Health Care Ethics’ (2011); many protests were also made by doctors and scientists against such atrocities.
 ‘But the privilege I would like to emphasize is that which is granted by the courts of law and which establishes the inviobility of the researcher’s right to withhold knowledge from public scrutiny.’, Huff, ‘The Rise of Early Modern Science: Islam, China, and the West’, pp. 9-10 (2003).
 ‘The bland and righteous belief among American academics that any degree of invasion of privacy, any degree of public exposure of the human psyche, is justified so long as it is in the name of science rather than, say, the TV industry,’, Nisbet, ‘Project Camelot’ (1966), in Smith & Bender, ‘American Higher Education Transformed, 1940-2005: Documenting the National Discourse’, p. 408 (2008).
 ‘Scientists make authoritative decisions in the name of others, such as on behalf of organizations or collective bodies, or in the name of science itself, and have such decisions made about them. Many of these are ‘gatekeeping’ decisions, and indeed the business of gatekeeping is perhaps the primary means of exercising authority in science.’, Turner, ‘Liberal Democracy 3.0: civil society in an age of experts’, p. 85 (2003).
 ‘industrialized science, tied as it is to the structure of the state, carries with it dangerous potential.’, Rosenberg & Marcus, ‘The Holocaust as a Test of Philosophy’, in Rosenberg & Myers (eds.), ‘Echoes from the Holocaust: Philosophical Reflections on a Dark Time’, p. 211 (1990).
 ‘The state and its various arms can kill, maim or exploit in the name of science.’, Nandy, ‘Science as a Reason of State’, in Abbas & Emi (eds.), ‘Internationalizing Cultural Studies: an anthology’, p. 27 (2005).
 ‘The change of perception was largely, if not soley, due to Darwin’s own work on evolution and published in The Origin of the Species (1859), and The Descent of Man (1871). A host of followers applied evolutionary theory to society and to the Aborigines, who were viewed as primitive, stone-age people who were earlier and less evolved than were Europeans.’, Reynolds, ‘An Indelible Stain?’, p. 146 (2001).
 ‘The Australian colonists deeply influenced by Social Darwinism had come to accept that, as a consequence of settlement, the indigenous people were dying out and the process would probably continue until it was complete.’, ibid., p. 146.
 ‘Scientific theories and arguments were used to support the inferiority of other races, thereby legitimising crimes committed throughout history and all over the world.’, Weigmann, ‘In the name of science’, EMBO reports (2.10. 871). 2001.
 ‘Even under social democratic governments, atrocities took place. In Sweden, for example, 63 000 people—including most resident gypsies—were legally sterilised between 1934 and 1975, mainly because of ‘antisocial behaviour’.’, ibid., p. 872.
 ‘Along with the methods of mass killing, science also legitimized the ideological basis, or the motivating cause, for mass murder.’, Rosenberg & Marcus, ‘The Holocaust as a Test of Philosophy’, in Rosenberg & Myers (eds.), ‘Echoes from the Holocaust: Philosophical Reflections on a Dark Time’, p. 210 (1990).
 ‘The fact that these claims were advanced and even believed in the name of science, and were expounded by scientific authorities, lent a high degree of credence to popular prejudices and made the acceptance of the idea of mass extermination so much easier for a large number of people.’, ibid., p. 210.
 ‘Never did they fake an expert report to save someone’s life.’, Weigmann, ‘In the name of science’, EMBO reports (2.10. 872). 2001.
 ‘In the past it was scientists who interpreted racial differences as the justification to murder.’, ibid., p. 874.
 ‘The second half of the twentieth century saw a strong movement toward public regulation of experiments on human beings and animals. In the case of human experimentation, initial impetus came from the exposure of atrocities performed in the name of science on the inmates of Nazi concentration camps.’, Guerrini, ‘Experimenting With Humans and Animals: From Galen to animal rights’, p. 137 (2003).
 ‘In the 1960s, however, it came to public attention that medical researchers in the United States and the United Kingdom violated the rights of human subjects routinely and with impunity.’, ibid., p. 137.
 ‘The established ethical controls did not work, because doctors and researchers had so many personal incentives to pursue what they believed to be important scientific objectives. The classical ethical virtues of a good doctor, as well as the ethical rules of ancient and modern codes, were both simply ignored.’, Drane, ‘A Personal History of Bioethics in Latin America: The Current Challenge to the Medical Profession and the Influence of Pharmaceutical Companies’, in Pessini & de Paul de Barchifontaine (eds.), ‘Ibero-American Bioethics: History and Perspectives’, p. 32 (2009).
 ‘In 1965 Henry K. Beecher, the Dorr Professor of Anesthiology at Harvard University, alerted the national press to a number of unethical studies of which he was aware. He had earlier raised these concerns in a professional forum and now “went public” only because he was outraged by his colleagues’ indifference to the issue.’, Guerrini, ‘Experimenting With Humans and Animals: From Galen to animal rights’, p. 139 (2003).
 ‘By the 1970s Beecher’s and Pappworth’s expose’s, and the revelation of the Tuskegee study, had demonstrated that biomedical researchers could not be trusted to adhere to the principles of the Nuremberg Code without the coercive inducement of national regulation.’, ibid., p. 141.
 ‘Despite the development of both the Nuremberg Code, published in 1947, and the Declaration of Helsinki nearly 20 years later, research was still being done without regard to the health and well-being of its participants. The literature cites many examples (Krguman et al., 1978; Campbell et al., 1992; LoBiondo-Wood and Haber, 1994; Lock, 1995; Dowd and Wilson, 1995; Nicholson, 1997; Homan, 1998)’, Hart & Bond, ‘Using action research’, in Gomm & Davies, ‘Using Evidence in Health and Social Care’, p. 109 (2000).
 ‘The question is raised why such a commendable code of ethics has had so little impact in two countries [German and the US] with long histories of unethical therapeutic and nontherapeutic experimentation, unethical eugenically oriented surgery, and medical abuse and exploitation involving Blacks and other disadvantaged groups.’ Byrd & Clayton (eds.), ‘An American Health Dilemma: Race, medicine, and health care in the’, p. 281 (2001).
 ‘As health lawyer and bioethicist George J. Annas noted in The Nazi Doctors and the Nuremberg Code: Even where the Nuremberg Code has been cited as authoritative, it has usually been in dissent, and no US court has ever awarded damages to an injured experimental subject, or punished an experimenter, on the basis of a violation of the Code.‘, ibid., p. 281.
 ‘not a single volunteer research participant refused to administer severe shocks to counterfeit subjects, when instructed to do so by a scientist in a white coat.’, Scheper-Hughes & Bourgois, ‘Violence in War and Peace: An Anthology’, Blackwell Readers in Anthropology, p. 16 (2004).
 ‘It should not come as a surprise that Milgram’s experimenter wore a white lab coat, embodying the authority of the expert research scientist pursuing knowledge. Whether by presence or by uniform, the more salient the authority figure, the more likely people are to obey, as can be seen in Figure 10.6.’, Smith & Mackie (eds.), ‘Social Psychology’, p. 399 (2000).
 ‘It was scientific and medical methods, scientific and medical speech that were used in carrying out these crimes in the name of science. Clearly, the scientific value of an experiment is not tainted by the experiment being carried out on murder victims. ‘It would be wrong to condemn them as bad experiments, if they were carried out on mice‘, writes Benno Müller-Hill,’, Weigmann, ‘In the name of science’, EMBO reports (2.10. 874). 2001.
 ‘Even today, we prefer to perceive the Nazi era as a period of ‘pseudo-science’. But this is dangerous, as it would relieve scientists from any responsibility for the crimes committed. ‘Criminal acts of this kind are an inexcusable shame, not only for those who prepared them, but also for all those who tolerated them, in fact for the life sciences themselves, in the name of which they were committed‘, Markl said in his speech.’, ibid., p. 874.
 ‘It would be easy to condemn these experiments – most of them conducted without anethesia and in horrific circumstances – as the work of madmen, but bioethicist Arthur Caplan warns that to do so would be to deny their character as a logical expression of the values of German medical science.’, Guerrini, ‘Experimenting With Humans and Animals: From Galen to animal rights’, p. 137 (2003).
 ‘Certainly, none of the doctors tried at Nuremberg pleaded insanity; rather, they defended their actions as consistent with the values of science and their duties as scientists.’, ibid., p. 137.
 ‘they argued that they were following orders, and that their training as scientists gave them no grounding in ethics that might justify refusing those orders.’, ibid., p. 137.