I heard an interesting expression on Morning Joe today: Put the grass down where the goats can eat it. Anyone who wants to think seriously about homophobia, racism, and religion should start by reading The Selfish Gene and then ask whether religion isn't how we put Dawkins's grass down where the goats can eat it.
You can capture virtually all religious sexual morality in four words: Mama's baby, papa's maybe. Gender roles, and especially restrictions on female sexual activity before and outside of marriage, all serve to assure men that the children they raise carry their genes. Men, on the other hand, can screw around all they want so long as their wives' children are cared for. (Adultery in not "OK," but the Muslim practice of "temporary" marriage (aka prostitution) probably says all we need to know about that issue.)
Homosexuals do not reproduce as such. Yes, they can reproduce sexually, but our genes react to the sight of a homosexual couple with an instinctive fear - yes, homophobia is rightly named - that to the extent those people share our genes, our genes are not going to be reproduced. (Ethnic minorities may be more openly hostile to homosexuality because ethnic minorities need all hands on deck, reproductively speaking.)
The quoted language about racial separation from the lower court in Loving v. Virginia is more of the same: race mixing does not sit well with our selfish genes. Which is why race mixing is the only way out of racism. What is natural is not necessarily good. But we really need to confront the extent to which what is natural is entrenched in our viscera. Rodgers and Hammerstein were very wrong about racism. It's anti-racism that has to be carefully taught.