I think it's very simple. If you spend all day thinking about gay dick, your body is going to react. Normally only gay mascs and horny women spend all day thinking about gay dick. Straight men don't have a reaction to gay dick because they don't condition that response. They don't think about gay dick for long enough for Pavlov to kick in. Homophobes condition themselves by constantly thinking about sex (hot; unconditioned stimulus) and gay (conditioned stimulus) at the same time. If they just quit thinking about gay sex all day, their fetish would go away. But that would require being less homophobic, and they can't. Then they get worried that they're gay, because they like dick, so they assume being gay is what they have. And since what they have sucks, they assume being gay sucks, which makes them more homophobic.
A similar thing happens in POCD, or Pedophile Obsessive Compulsive Disorder. The fear of being a pedophile conditions an association between children and arousal, which self-reinforces in a vicious cycle. Fortunately, most people with POCD are not fascists, so they're capable of having a normal response to it in which they don't proceed to deliberately indulge in the association. In order for someone to be homophobic and suffer the same thing with gay thoughts, their judgement has to already be compromised, which produces a more toxic reaction.
We can't deny their desire, but we can stop them from gaining that desire in the first place. We need to put an R rating on all princess movies and save them for when the kids turn 18. Within a couple generations, that would probably fix the problem as people adapt to the new culture. We could speed up the process by banning princess costumes at family-friendly events like trunk-or-treats. Parents could explain to their kids "Sorry, you can't be a princess this halloween. You need to set a good example to the younger kids. You can be something scary like a witch or a ghost, but you can't wear a costume that degrades your own dignity as a person." Not every kid is mature enough for that explanation, so it would be left up to parents' discretion when to have that conversation and how mature to make it.