There is actually quite a lot of research on this but here is just some quick links to mull over:
So, it is sometimes true that the reason why some people have antipathy toward homosexuals is because they are homosexuals themselves. And they hate and are unable to accept who they are. And the more extreme aversion they have and more they continue to express this hate the more than likely they are hidden homosexuals. Of course, this isn't a reflection of all homophobes; but it still does represent a numerous sample of people.
What's more, is that they are going to be even more ashamed and angry with themselves if they were bought up in religious backgrounds and with very authoritarian parents/guardians. And all of this does get reflected in their actions and then their words.
Sometimes the only way for some people to accept homosexuals is by first coming to terms with their own sexuality.