As long as there has been racism, people have been trying to justify it to themselves and others. Unfortunately, all too commonly, religion has been a prime factor in these justifications. While the Atlantic slave trade was just beginning, before slavery was made hereditary, slavery was justified by the simple fact that slaves weren’t Christian. Worse—they didn’t even know about Christianity! It was obviously necessary to capture them all and take them under the loving wing of white overseers in order to educate them about the Lord and Savior, right? Jesus did say to go and make disciples of all men! And otherwise they wouldn’t be able to get into heaven! And Christian salvation was just the first perk in a long line of awesome things slaves got for being slaves!
Yeah, that was my sarcasm voice.
Slavery is rampant in the Bible. The Hebrews were God’s chosen people, and they had slaves. Not only did they have slaves, but God must have approved of them doing it, because He gave them specific rules in Deuteronomy and Leviticus on how to do slavery the Yahweh way. In the New Testament, in St. Paul’s Letter to Philemon, Paul doesn’t so much reject the idea of slavery as he recommends that slaves and their masters maintain an imbalanced system of mutual respect, e.g. slaves should be obedient to their masters, and masters should repay that obedience with compassionate lordship. (Sounds a lot like what he had to say about marriage, so, uh, yikes on that one, dude.)

(via Beacon Broadside)
In the beginning, God created a bunch of stuff, including Adam. In both of the Creation stories included in Genesis, part of the myth involves God granting dominion over the earth and all the creatures He created to Adam, to hold in stewardship. As nonwhite peoples, in particular Black Africans and brown Native Americans, were seen as lesser, subhuman, and savage by white colonialists, it was easy to argue that this sense of God-given stewardship, this paternalism by divine right, should extend to include these other races. (The troubling principles of social Darwinism later lent pseudo-scientific credence to these arguments.) Instances of cultural genocide like the Trail of Tears, the doctrine of manifest destiny, and the Indian Residential School System were all in some way justified by the God-given belief that the white man had authority over how these “lesser races” should be living their lives.
Now, this is all horrifying and unpleasant to say the least, but what does it have to do with geeky stuff? Well, this Christian paternalist mentality is front and center in the Harry Potter universe, with the serial numbers filed off just enough to make it kind of secular.