Homophobia does not stem from religious beliefs. It's lack of education.
I grew up in a very strict cult-like religion. I can say that for the more strict religions, education is not the issue at all. One of my parents has a PHD, yet would pull me out of science, health, and social studies classes any time I was to learn something that didn't match my parents beliefs. If my parents forgot and I got to go to those classes, they would always sit me down after school and explain why the things I learned were wrong/not true/why it goes against the religion so therefor it can't be true.
Those people are so deep into their religion that when they receive truth and education that doesn't match their beliefs, they aren't hearing the facts and instead are instantly thinking about how to reject it. Education only works when the people are at least somewhat open to hearing things that go against or don't fully align with their beliefs. People like my parents aren't open even 1 percent, and I think this goes for some portion of Christians, Muslims etc. Of course this does not apply to everyone in these religions, just the most fanatic of certain religions.
The homophobia is often a symptom from the beliefs but once again I think it depends on how deep those beliefs run.