I have a friend who lives in the Italian countryside in a medieval house with such an abundance of doors, staircases, rooms and cellars you could disappear for days and nobody would realise you were lost and not merely anti-social.

Next to it stands a chapel that's even older. Apparently, when a priest arrived back in the 15th century, he built this house beside his workplace, making sure it was large enough to accommodate his harem and their numerous offspring. It was a convenient and economical arrangement and, insofar as one can tell, happily accepted by all.

In the middle ages, clerical celibacy was the ideal, but not always the norm. Stories of bishops flaunting mistresses are countless, hint at a widespread acceptance of the sometimes intolerable strain of abiding by a church law which, many believed, was not essential to a good spiritual life.

Headlines about the Vatican and Cardinal Keith O'Brien, head of the Catholic Church in Scotland, would lead you to assume that even in this vastly more transparent and public age, and despite their vows of celibacy, sex plays an astonishingly large part in the life of the Catholic clergy. It has emerged that three priests and a former priest have lodged complaints against Cardinal O'Brien for "inappropriate acts". Yet whether the cardinal – who contests these – is innocent or guilty, the fact that priests have felt able to make official accusations against a man in his august position is remarkable. Fifty years ago, such a thing would have been unthinkable. At the very least, it would almost certainly have spelled the end of a priest's career.

In the light of these allegations, the timing of the previous report that Cardinal O'Brien suggested the church ought to consider the idea of ordaining married priests was rather curious. This statement quickly led to a flurry of theological experts eager to put the cardinal's comments into context. He was not, they stressed, advocating that Catholic priests could soon hope to become married, rather that married lay-people or married clergy from other denominations could be ordained as priests.

Nevertheless, his seemingly off-the-cuff remarks are significant, hinting as they do that at long last some in the Catholic Church acknowledge it should reconsider its inflexible position on celibacy. A merciless critic of practising homosexuals, the cardinal was referring, obviously, only to straight priests, but following the litany of accusations across the Catholic church of sexual abuse, much of it involving not just laity but also priests, it is surely time for the church to face up to issues of sexuality of every sort within its ordained ranks.

As one scandal follows another, it is clear there is extreme dysfunction within the clergy at every level. Rumours published last week in La Repubblica that the Pope's resignation was prompted by an internal report detailing a coterie of gay prelates in the Vatican have been neither confirmed nor denied by his spokesmen. But that Benedict XVI is considering releasing this explosive document ahead of the vote on his successor indicates a church in severe crisis, and all of it over sex.

The days when priests earned unthinking respect are long gone. Many devout Catholics have been horrified to discover the depths of hypocrisy some priests have been capable of, either in their private behaviour, or in covering up the criminal wrong-doing of others. Now, as the church reels at each new revelation, the picture is ugly. Rocked to its roots, this once monolithic institution is going through an excruciatingly painful, disturbing and humbling epoch, in which the deeply damaging consequences of thwarted or – in the case of paedophiles – deviant sexual desires have been made public. Indeed, this tumultous, disillusioning period might eventually prove as pivotal in Catholic history as the Reformation.

One almost hopes that will be the case. After all, a growing willingness to discuss sex and celibacy honestly, openly and compassionately could be the most positive, enlightening and liberating conversation the church has ever had.