Who knew cleaning wipes had so many diverse uses? Removing spilt pasta sauce from dining tabletops; exterminating bacteria in kitchens; wiping away the gay. According to research released last week, straight people show the need to "physically cleanse" at the very thought of contact with gay men. "Yuck", was my initial reaction – sadly, a response reciprocated among many of the study's participants – but they do provide a fascinating insight into what makes homophobia tick.

Let me explain what the researchers at Goldsmiths University found. In the first study, British students who were asked to imagine borrowing a phone from a gay man came up with significantly more words about cleansing in a word-completion task. In another study, Portuguese students were offered either a yellow pencil or yellow disinfecting wipe after the experiment; those who imagined borrowing a phone from a gay man were more likely to choose the wipe. And, finally, Polish students – again asked to imagine borrowing a phone from a gay man – expressed a preference for cleaning products. Seems pretty definitive: on a subconscious level, gay men are seen as a contaminant, something to be washed away. "Ugh, I've got gay on me!", if you will.

As a gay man, maybe I should be hurt, hesitant in future to offer my hand in greeting to another person in case I trigger a subconscious urge to reach for the anti-bacterial gel. But actually the findings intrigued me, because prejudice can only be washed away (if you will) when it is understood. One possible explanation is what you could call an HIV/Aids crisis hangover. HIV was, after all, once the "gay plague" (Aids was originally christened Grid – gay related immune deficiency); good old-fashioned homophobia fused with the dread of a frightening illness. From my experience, this isn't a phenomenon exclusive to straight people: some gay men admit that their own chronic fear of HIV is down to an internalised sense of shame. But actually, Agnieszka Golec de Zavala – one of the researchers – tells me this is one of the least interesting explanations.

The most compelling theory is that this impulse to scrub off gayness has everything to do with group identity. Cleansing is about separating: it has "a very social meaning" as de Zavala puts it. If you have established a clear division with another group, that they are "the other", and you convince yourself that you have nothing in common with them, then any form of interaction becomes contamination. It makes sense: cleansing is often used as a metaphor to separate ourselves from groups we disapprove of. How many of us have joked "I hope you had a bath afterwards!" to a friend who has spent time with some perceived undesirables? In its most sinister form, cleansing has underpinned the rhetoric of racist totalitarian regimes: the Nazis were fixated with "racial purity" and Mussolini was obsessed with the colour white. "Ethnic cleansing" is the perverse euphemism for terrorising other ethnic groups.

This entirely gels with a proper understanding of what homophobia is. Rather than a straightforward dislike or fear of gay people, homophobia is often about "gender policing": protecting the boundaries of what it is to be a man. Homophobia is not only directed at gays, after all: straight men suffer it, too. From an early age, those who don't conform to a certain type of masculinity – not being aggressive enough, not speaking about women in sufficiently degrading terms, not being athletic, and so on – risk being labelled a "poof". This has everything to do with sexism and misogyny. Both straight men who don't conform to type and gay men are seen as womanly, and being like a woman is considered degrading.

The rather creepy research findings show that the more conservative the man, the stronger the impulse to wash away gay contact. Hardly surprising: more conservative men tend to have a stronger belief in gender difference, in protecting a more unreconstructed masculinity. Gay men are the ultimate menace to this identity, a threat to heterosexual solidarity: the contagion to be washed away.

That's why – without sounding complacent – homophobia is ultimately doomed. Being a man isn't a static concept. Before the 18th century, it was widely believed that men and women were part of the same sex, and that women's vaginas were actually penises tucked inside the body. The idea of a rigid division between the genders only became dominant in the 19th century: but, with the rise of the women's and LGBT movements, this division has been dramatically eroded. According to the Social Attitudes Survey, in 1987, nearly half of Britons agreed that "a man's job is to earn money; a woman's job is to look after the home and family"; but that has now toppled to around one in 10. The number of "househusbands" has trebled in 15 years (admittedly from a low base); men are more open about their feelings (though not enough); male grooming is projected to be worth £1.1bn by 2017; and polls show young people overwhelmingly back gay rights and are far more likely to have gay friends than their grandparents. The old binary divisions are being swept away.

Sexism – and its bastard offspring, homophobia – still abound, of course. But because of the struggle of the women's and LGBT movements, identities are now more fluid and the urge to protect an oppressive, unreconstructed form of "manliness" becomes weaker. A society free of sexism and homophobia won't just emancipate women and gay men: it will free straight men, too.

Twitter: @OwenJones84