In Exterminate All the Brutes, Sven Lindqvist discusses and explores how science played a key role in the racism that permitted and even sanctioned colonialism. Although we like to think of white supremacy as an aberration, Lindqvist is at pains to show how racism was common among Europeans. It was given an intellectual veneer by scientists, philosophers, and thinkers. Darwin had introduced the idea of the survival of the fittest—some applied this to the human race as well. If the black people of Africa were being exploited and exterminated, it proved that they were an "inferior" race and that colonization was just part of nature.
Darwin, for all his enlightened ideas, expressed his thought that the "civilized" people of the world would eventually replace the "savage" people. His cousin, Francis Galton, took this one step further. He put forth the idea of breeding out the "inferior" races (and inferior people in general) through eugenics, an idea popular with the Nazis.
A French scientist, Georges Cuvier, (whom Lindqvist calls the "Napoleon of French science") had similar views. He set up a hierarchy of the human races and pointed out that animal species went extinct, so why would certain races of humans not? Other scientists, when classifying humans, thought there were not only different skin colors but different types of humans. That is, the black and brown races were lower, more barbaric, and less civilized. This de-humanizing of a whole group of people made it easier to treat them inhumanely. Lindqvist connects these ideas with the Nazi ideology of race and the resulting genocide. Also look at the ideas of Robert Knox on this topic.
For more on "scientific" racism, Ibram X. Kendi's Stamped from the Beginning is an excellent history.