A fresh attempt to overturn a Singapore law banning gay sex has failed after a court dismissed several challenges, marking a setback for efforts to promote greater LGBT rights in Asia.

The law, inherited from the British colonial era, is rarely enforced but campaigners say it jars with the affluent city-state’s increasingly modern and vibrant culture.

But others argue that Singapore remains at heart conservative and is not ready for change. Officials believe most would not be in favour of repealing the legislation.

The latest attempt to overturn the law was led by three people – a retired doctor, a DJ and an LGBT rights advocate – who lodged court challenges seeking to prove the law is unconstitutional.

But the high court dismissed all three after hearing them together behind closed doors. It ruled that the law did not violate articles of the constitution regarding equality and freedom of speech.

The court also found the fact the legislation was not enforced did not “render it redundant”. “Legislation remains important in reflecting public sentiment and beliefs,” according to a summary of the judgment.

M Ravi, a lawyer for one of the complainants, told reporters outside court he was “very disappointed”. “It’s shocking to the conscience and it is so arbitrary. It is so discriminatory this legislation,” he said.

A first challenge to the law was dismissed in 2014. The repeated failure to overturn it contrasts sharply with progress made elsewhere in the region on lesbian, gay, bisexual and transgender rights.

In 2018, India’s supreme court decriminalised gay sex by overturning legislation from its period under British rule, a decision that spurred campaigners in Singapore to renew their efforts.

And in Taiwan, lawmakers took the unprecedented step last year to legalise same-sex marriage, making the island the first place in Asia to do so.

Singapore’s ban, introduced in 1938, carries a maximum penalty of two years in jail for homosexual acts.