Fear, a reaction to the feeling that your identity is being attacked/disparaged is the root cause on both sides. The first, instinctive, reaction to fear is the 'fight or flight response’.
Response to 'fight’ is anger/hatred, attack.
Response to 'flight’, is “keep your head down, don’t talk about it or even acknowledge it”, or, simply, “stay in the closet”.
It’s a societal problem. It can only be “cured” by lovingly encouraging children to explore, experiment, until they arrive at the 'identity' that feels natural and right, happy to be who they are.
Until then, the fear/anger/hatred will continue to plague us.
Fear,(as relates to self-esteem), is the bane of human society.😪