Some of the most senior clerics in the Roman Catholic church who have vociferously attacked homosexuality are themselves gay, according to a book to be published next week.

Eighty per cent of priests working at the Vatican are gay, although not necessarily sexually active, it is claimed in the book, In the Closet of the Vatican.

The 570-page book, which the French journalist and author Frédéric Martel spent four years researching, is a “startling account of corruption and hypocrisy at the heart of the Vatican”, according to its British publisher Bloomsbury.

It is being published in eight languages across 20 countries next Wednesday, coinciding with the opening day of a conference at the Vatican on sexual abuse, to which bishops from all over the world have been summoned.

Martel, a former adviser to the French government, conducted 1,500 interviews while researching the book, including with 41 cardinals, 52 bishops and monsignors, 45 papal ambassadors or diplomatic officials, 11 Swiss guards and more than 200 priests and seminarians, according to a report on the Catholic website the Tablet.

Many spoke of an unspoken code of the “closet”, with one rule of thumb being that the more homophobic a cleric was, the more likely he was to be gay.

Martel alleges that one Colombian cardinal, the late Alfonso López Trujillo, who held a senior Vatican position, was an arch-defender of church teaching on homosexuality and contraception while using male prostitutes, the Tablet said.

The author found that some gay priests accepted their sexuality and a few maintained discreet relationships, but others sought high-risk casual encounters. Some were in denial about their sexuality.

Although the book does not conflate homosexuality with the sexual abuse of children, Martel describes a secretive culture among priests that creates conditions in which abuse is not confronted, say people familiar with the book’s contents.

According to Bloomsbury’s promotional material, Inside the Closet “reveals secrets” about celibacy, misogyny and plots against Pope Francis. It uncovers “a clerical culture of secrecy which starts in junior seminaries and continues right up to the Vatican itself”.

Francis has riled his conservative critics in the Vatican over his apparently softer tone towards gay people. A few months into his papacy, he told reporters who asked about a “gay lobby” at the Vatican: “If a person is gay and seeks God and has good will, who am I to judge?”

Last year Juan Carlos Cruz, a Chilean survivor of sexual abuse, said Francis told him in a private meeting: “Juan Carlos, that you are gay does not matter. God made you like this and loves you like this and I don’t care. The pope loves you like this. You have to be happy with who you are.”

But a Polish priest who was sacked from his Vatican job and defrocked after announcing he was gay has accused the church of making the lives of millions of gay Catholics “a hell”.

In a letter to Francis in 2015, Krzysztof Charamsa criticised what he called the Vatican’s hypocrisy in banning gay priests and said the clergy was “full of homosexuals”.

In December, Francis was quoted in a book about vocations as saying homosexuality was a “fashion” to which the clergy was susceptible.

“The issue of homosexuality is a very serious issue that must be adequately discerned from the beginning with the candidates [for the priesthood]. In our societies it even seems that homosexuality is fashionable and that mentality, in some way, also influences the life of the church,” he said.

The timing of Inside the Closet’s publication, at the start of a milestone summit on sexual abuse, will raise concerns that some people may seek to conflate the two issues.

But the book’s allegations are likely to be pored over by senior bishops flying into Rome from more than 100 countries for the four-day summit.