The fear of strange, different, unfitting, or deformed people has evolutionary past. We are social creatures, and we are the product of the strongest groups/tribes of our ancestors. Obviously homosexuality wasn't the trait that made groups strong therefore wasn't accepted and we are paying price for it now in our liberal societies of today. The traits that made groups united and strong were spiritual/religion, arts/dances/group activities, fashion/traditions, heroism/sacrifices in war, cooperation/sharing, communication/peace within tribe, pride of your tribe/origin related to egocentricity (precursors of nationalism and racism),to name important once.
By negative behavior of most people toward homosexuality, one can deduct that homosexuality was more of a spoiler of the group coherence than a building block, hence having a tough time to become accepted even in today's free world. It also might be a side-effect of fear of anything or anyone that is different than average group norm.
The simplest way to get away with this problem is to educate new generations that homosexual people are valid, full members of our society, our group. If it is all us, there is no they.
The same group instinct that divides groups/nations, can be used to unite, if we all believe that we belong to only one group. There will be no hated "they", it will be only "we".