On Wednesday India’s Supreme Court turned the clock of history backwards when, in defiance of all expectations, it set aside a landmark 2009 High Court judgement that had ruled homosexuality could not be construed as a criminal offense “against the order of nature,” as held for more than a 150 years by Article 377 of the colonial-era Indian Penal Code.

In doing so, the Supreme Court effectively re-criminalized gay sex, making second-class and stigmatized citizens of those it revealingly called “a minuscule fraction of the country’s population,” and returning them to what the novelist Vikram Seth, one of the gay-rights movement’s most lucid voices, called “lives of quiet desperation.” To look at it another way, the Supreme Court decided that the High Court had overreached in exercising its powers of judicial review, and placed the onus for a change in the law on Parliament instead.

The ruling means that what is in truth a question of personal liberty has once again become hostage -- as it has been for decades now -- to the tyranny of public and religious morality, including the beliefs and prejudices of lawmakers. A minuscule fraction of India’s parliamentarians are under 50 (which means the rest likely grew up in an environment in which homosexuality was unequivocally thought of as an aberration), and none are openly gay. This makes it unlikely they will consider the question of gay rights a specially urgent one.

The more realistic hope is that the judgment passed today by Justice G.S. Singhvi on his last day in office will on appeal be referred to a larger bench of judges, which will once again uphold the 2009 ruling. That judgment had held that Section 377 of the IPC “was based on a conception of sexual morality specific to [sic] Victorian era,” that it had been struck down in England as far back as 1968, and that it violated many fundamental rights guaranteed by the constitution, including the right to privacy and to equality before the law.

Today’s judgment represents a victory for the alliance of Hindu, Muslim and Christian religious groups (otherwise almost never in agreement), as well as organizations seeking the codification in law of “Indian cultural values,” that had come together to challenge the 2009 judgement on Article 377. While Justice Singhvi’s decision is one that will distress many Indians who seek a society more receptive to the right of people to make choices about their own sexual lives and orientations, the reality is that it was the judgment of 2009 that was surprising in the unusual maturity of its detached consideration of homosexuality.

In contrast, the one delivered today was broadly representative of the collective inability of lawmakers and society -- not just in India, but in each one of the great civil-rights movements in modern history -- to think through the lens of rights rather than personal beliefs. As the scholar Martha Nussbaum has noted, disgust has always had a disproportionately powerful role in debates about the legality of same-sex sexual relations. That emotion was given full vent on Indian television debates today in the wake of the judgment, with spokesmen for religious and conservative groups equating homosexuality with bestiality and repeating long-held claims about the sanctity of “the order of nature.”

Today’s judgment notwithstanding, the eventual legalization of homosexuality in India is inevitable. At least in the realm of the public sphere, if not that of the law, the gay-rights movement has made remarkable and permanent advances in the last two decades. And at least in large sections of urban India, the culture of shame and silence that attached itself to homosexuality in the past has been to a great extent broken down.

What’s heartbreaking is that the ruling of 2009 was such a positive step in the right direction. As each one of us knows in one context or another, it’s much more wrenching and dispiriting to be propelled backwards after having gone forward than not to have moved at all.