I flinched when Alan Carr's new ad for animal rights campaigners Peta made its debut on social media. There he was, smiling cheekily as he posed with a set of pink wings and a pink wand, beneath luminous pink text inviting us to "be a little fairy for animals". Yuck, I thought to myself: that'll really help along the stereotype of gay men as a bunch of mincing court jesters.

When the inevitable Twitter backlash came, I quietly empathised with it. "Anyone find the Peta ad campaign really fucking offensive?" tweeted one infuriated gay man. "Basically: gay men = fairies." But then Carr faced his detractors down with aplomb: "The most homophobia I get is from gays," he tweeted back, completing his riposte with a dig at their alleged "self-loathing". And then I felt quietly ashamed to have flinched in the first place. Carr's defiant response forced me to examine prejudices I share with all too many other gay men.

This is how I could have justified my instinctive flinch. When gay people appear on TV, it is invariably as one-dimensional, caricatured camp clowns, a kind of gay minstrel show. But Carr has never claimed to be emblematic of gay men. Of course we should see a wider spectrum of gay men – including, say, the beer-swilling, football-obsessed lad alongside the body-pumping Kylie-loving scene queen – but why does that mean discriminating against a funny comedian because he's outrageously camp? What fuelled the backlash was a sense that the likes of Carr invite homophobia with their loud-and-proud campness, and all gay men suffer as a result. It is complicity with oppression, not dissimilar to the woman who suggests wearing a short skirt is asking for a sexual attack.

Gay men have a big problem with camp. Gay dating websites abound with profiles specifying "straight-acting men only". Despite the widespread myth that campness is affected – that it's all for show – most gay men think camp is deeply unsexy. Graham Norton – another screamingly camp comedian – has said that campness is "a much harder thing to accept than being gay", because it "comes with judgment all round". This anti-camp hostility partly comes from a desire to conform to traditional gender roles, which gay men have already subverted whether they want to or not. But Carr has a point: some anti-camp bashing is driven by the homophobia of gay men.

That homophobia remains rife among gay men is hardly surprising. They grow up in a society that teaches that settling down with a woman is the natural order of things. They hear "gay" casually bandied around as an insult, a synonym for crap or rubbish. They see the horror etched on the face of a straight man misidentified as gay – the sort of expression that comes from being wrongly accused of the most heinous of crimes. Gay men know that to hold hands with a partner in public risks stares and abuse. In The Velvet Rage, the clinical psychologist Alan Downs talks of an internalised shame, too: that gay men are taught "during those tender and formative years of adolescence that there was something about us that was flawed, in essence unlovable".

No wonder gay men suffer higher rates of mental distress and suicide. But, if most gay men are honest with themselves, they can think of more subtle ways in which their own homophobia expresses itself. They may panic when someone asks if they have a girlfriend, knowing that an honest answer means coming out for the third time that week and possibly being treated differently. They may refer to their boyfriends in ways that strip their gender away, like "my other half". They may feel a sense of flattery when someone says "I'd never have guessed you were gay!", as if feeling reassured that their leprosy is barely visible. Or they may start by coming out as bisexual (fuelling a sense of "bi now, gay later", much to the annoyance of genuine bisexuals), hoping that having one foot in the straight camp might preserve a sense of normality.

There is evidence to suggest some "straight" homophobes are self-hating closet cases. A study in the Journal of Personality and Social Psychology suggested that some homophobic people were suppressing same-sex desires, backing up another study which showed that prejudiced people were more likely to be aroused by gay porn. Even today, some gay people take "straight-acting" literally, trying to force relationships with opposite-sex partners, imprisoning both in the misery of denial.

This isn't to paint an overly bleak picture. In the UK, there's never been a better time to be gay: the majority of anti-gay laws have been overturned; and while 30 years ago half of Britons thought same-sex relations were always wrong, that figure has dropped to a fifth. Being gay can be a bit of a leveller, too: whether you're a millionaire or a barman, there's a unifying sense of being an outsider, like it or not. But homophobia is corrosive, wherever it comes from. Gay men may recognise it and challenge it when it comes from straight people. It is much harder – but still necessary – to recognise the homophobia that dwells within the ranks of gay men themselves.

Twitter @owenjones84