Places of worship that deny or restrict women’s entry undermine the fight for gender equality and have no constitutional right to do so, the Indian supreme court said, in the latest boost for women demanding equal access to temples, mosques and other holy sites.

The country’s highest court told the board that manages the popular Sabarimala Ayyappa Hindu temple, in the southern state of Kerala, to explain why it bans women.

“What right does the temple have to forbid women from entering any part of the temple? Can you deny a woman her right to climb Mount Everest? The reasons for banning anything must be common for all,” Justice Dipak Misra, head of a three-judge bench, said on Monday.

“Gender discrimination in such a matter is unacceptable,” he said, adding that the temple’s arguments must be based on the nation’s constitution. The struggle for equal access to places of worship in India has triggered a wider debate on women’s rights in the country, with the hashtag #RightToPray trending on Twitter.

The Sabarimala temple is one of a few in India which bars entry to women aged between 10 and 50 years old, saying that menstruating women are impure. Discrimination against menstruating women is common in some parts of south Asia, where they are forbidden from entering houses or temples and taking part in festivals and community events.

“Banning on the basis of age is not practised in the Hindu religion,” Ravi Prakash Gupta, of the Indian Young Lawyers’ Association, which launched the petition against the temple, said. The association said it had received death threats over the petition.

The supreme court comments came days after the Shani Shingnapur temple in Ahmednagar, in the western state of Maharashtra, opened its inner sanctum to women following a Mumbai court ruling that it was the fundamental right of women to enter any place of worship that allows men access, and that the state should protect this right.

The Mahalaxmi temple, also in Maharashtra, followed suit on Monday and allowed women entry. In a separate case, two Muslim women are demanding access to a landmark mosque in Mumbai.

Sabarimala authorities have said the ban on women is rooted in a centuries-old tradition and is essential to the rites related to the temple’s chief deity, Ayyappan. “You can’t look at the issue from the angle of worshippers alone. It has to be seen from the point of the god being worshipped, a celibate,” senior counsel KK Venugopal told the court.

The next hearing is on 13 April.