A lot of it - I won't say all - is down to a single, primitive and perhaps rather silly fear.
The fear of straight, cisgender men that they may find themselves being attracted to someone who is not a straight, cisgender woman!
The fear of being labelled queer. The fear that you might actually be queer. All very old-fashioned and patriarchal, you may say, and to an extent, you'd be right.
But the role of the male in nature is to father offspring. Among some insects, it is indeed the only role the male has and he dies as soon as it is complete. We're not insects, I know (though some people do resemble cockroaches), but that concept of the male as the fertiliser is buried deep in the reptile brain and has informed so much of our culture over the millennia. So much so that at one point, sexual behaviour among males that did not lead to the production of children was considered a threat to the tribe/society. The result of this was that many gay men married and raised families, not only to conceal their true sexuality, but out of a sense of duty.
We know better now. We know that gender and sexuality for all of us is much more broad and nuanced than that. But as H G Wells' Dr Moreau complains "The beast-flesh keeps creeping back!" Now that early and prolific breeding is no longer key to surviving as a species, we are more free to explore the nuances. Unfortunately, nobody has told our DNA about that, and many of us still listen to the reptile rather than the human brain!
Measures to help? We could start with gender-neutral upbringing, free of behavioural expectations bsed on biological sex.