Where do homophobia and transphobia come from? Many people point to religion as the root cause. But the belief that religion is to blame is a reworking of an old argument first fought out in the 1840s.
Then as now there was an argument about where awful ideas come from and how we can change them. It was not Richard Dawkins who first said that "religion is the root of all evil" but the philosopher Ludwig Feuerbach. It was against Feuerbach's ideas that Marx and Engels first formulated their ideas of historical materialism.