A few years ago, I was on a studio-based television show. One of my fellow guests was a reasonably well-known Catholic priest. He was in a buoyant, perhaps reckless mood, pepped up by the adrenalin surge that comes with the nervous anticipation of a live appearance before the nation. And he was charmingly, delightfully camp.

He flirted harmlessly with everybody, made amusingly risqué comments to the make-up ladies about another male guest who had just sat in the same chair, created self-consciously exaggerated gestures with his hands. He was for all the world like Mary O’Rourke in a dog collar.

I watched on the television in the green room as he went live on air, riveted to see what the nation would make of this camp clerical persona. But the persona had vanished. The priest had performed an exorcism on himself. It would not be true to say that he was now a paragon of macho manliness. But there is a priestly demeanour – soft, asexual, unthreatening, controlled, precise – and he seemed to have just slipped it on like a mask. He was fluent and self-confident and charming, but all the campy exaggerations were gone. The charm was now bland, the body language stilted, the voice half an octave lower.

I have no idea whether or not the priest in question is gay and it’s none of my business anyway. Being camp doesn’t mean you’re gay and most gay men are not camp. But it was pretty clear, at least, that he was quite comfortable, behind the scenes, with a version of himself that matched a certain kind of gay male persona. And equally clear that he could switch that persona off at will, that he could be a different person on the altar, on the pulpit, in a parishoner’s home, on television. Maybe he had worked out some kind of compromise with himself and, if so, he seemed able to manage it with admirable agility.

Everybody who has had contact with clergy over the years knows that there are many, many priests who are gay. How could it be otherwise? At the very least, one would expect the same proportion of homosexuality in the priesthood as in the general population. But – and Colm Toibín has written particularly perceptively about this – the likelihood is that the proportion within the priesthood is actually significantly higher than among the general population of men.

Sexuality is a very troubling issue for young gay men, especially if they come from families where coming out would be impossible. The celibate priesthood seems to offer a refuge from those storms of doubt and guilt. Even when it becomes clear that the storms will not subside, the black suit and white collar create a decent disguise.

There’s no great shame in this. There are far worse sins than hypocrisy and if everyone who is hypocritical about sex were sent to hell, heaven would be an awfully lonely place. But it is awfully weird. It creates an institution that is very like the priest I encountered in the TV studios: with one face for the public, another in private. There may be some hermit in the mountains or anchorite in the desert who does not know that many, many priests, nuns, bishops and cardinals are gay. But for everyone else in the church, it’s just a fact – a fact that cannot be true.

How those who are gay cope with their situation is their own affair, but there are some public consequences to this strange doubleness. One of them is particularly paradoxical: it ups the ante in the game of homophobia. Knowing that many good priests are gay doesn’t result in tolerance and decency. It creates a perverse form of denial, that of protesting too much.

It is, alas, not at all accidental that Cardinal Keith O’Brien, alleged by four priests to have “attempted to touch, kiss or have sex” with them, has been the most hysterical denouncer of proposals to legalise gay marriage, which he compared to legalising slavery.

Even more damagingly, but just as paradoxically, the two-faced approach has fed into the church’s appalling responses to child sexual abuse. The confusion and evasion that surround the perfectly normal state of homosexuality generated an atmosphere in which all sex, whether with consenting adults or with victimised children, is treated on the same level, as a fall from grace and an administrative problem to be managed.

And, in the end, the church’s double life in relation to homosexuality is just cruel. Some priests manage maintaining two different personas very well. Some perhaps even take a kind of pleasure in it. But for some, even at the very top of the clerical tree, it is an appalling strain.

When the desire to touch and be touched, to love and be loved, is “inappropriate behaviour”, it must become appallingly hard to know what is and is not appropriate. In an age when covering up the inevitable outbreaks of desperate desire is increasingly impossible, the church must learn to embrace what is normal and natural.