I believe this is largely due to ignorance.  They think they can "catch the gay" or that if they hang out with gay people, they will suddenly "turn gay."  It also has to do with some religious fanatics and their teachings.  Last, but not least, some people are afraid of what they don't understand.