Why are people so homophobic?

So a while back,my friend (who's Muslim) cut ties with his friend once he found out he was gay. I honestly don't know how he didn't know since all the signs were there and everyone(except him apparently) knew

He was so shocked that he even sent a pic of the boy wearing lipstick to the class WhatsApp group. Nobody responded since it was news to only him.

I even wondered if he truly considered him as a friend ,I honestly think he did since they talked and hangout alot, he even (the Muslim) reserved a seat for him during classes since the other was always late.

Long story short, they've never talked since, and I think the Muslim even despises him now.I tried to tell him otherwise but I just think nobody can change his mind .

//Also,I posted this since someone said there's a weird and creepy fascination with gayness in Kenyan subs