Manil Suri is a professor of mathematics and an affiliated professor of Asian studies at the University of Maryland, Baltimore County. He is the author, most recently, of the novel “The City of Devi.”

The Indian Supreme Court’s egregious judgment reinstating a 19th-century law criminalizing homosexual acts between consenting adults has drawn well-deserved condemnation from international bodies such as the United Nations and even leaders of India’s national governing party. The ruling does, however, offer valuable insights into the fallacious beliefs the court used in its reasoning. These beliefs are harbored by India’s deeply conservative society, whose cultural liberalization has been far outpaced by its economic progress, and would need to be addressed to realize true change, regardless of whether same-sex acts are eventually legalized.

The Dec. 11 ruling overturned a lower-court decision in 2009 that the colonial-era law criminalizing gay sex was unconstitutional. The ruling’s most astounding, and illuminating, assertion is that lesbian, gay, bisexual and transgender (LGBT) individuals form only a “minuscule fraction” of India’s population, which the justices contend is too small for a constitutional violation to have occurred. Although this flies in the face of even conservative estimates of the number of Indians attracted to individuals of the same gender, it reflects observable facts: There are a few pride marches and festivals and even the occasional gay character in Bollywood films, but only a small fraction of Indians appear to believe that they have met a gay person. The experience of Western countries has shown that only increased visibility can correct such unawareness.

This lack of visibility gives rise to another incorrect presumption in the ruling: Homosexuality must be an alien phenomenon. This wrongly implies that a permissive stance toward homosexuality must contradict the national ethos. The ruling criticized previous judges for relying too much on foreign precedents in their “anxiety to protect the so-called rights of LGBT persons.” Unfortunately, the court, like the population at large, got it backward: The reinstated decree against sodomy, known as Section 377, is the foreign imposition. The statute was passed in 1860 as part of Britain’s colonization of India. Other former British colonies, from Malaysia to Jamaica, have the same law on their books, also labeled Section 377.

In contrast, a text as old and authentically Indian as the Kama Sutra catalogues, in exuberant detail, male-on-male and female-on-female couplings. Whereas some cultures prescribed harsh penalties for sodomy, ancient Hindu texts generally cited mild rebukes. For instance, the Laws of Manu prescribe a bath with one’s clothes on. Notwithstanding its general unease with homosexuality, India has historically been quite comfortable with unconventional gender roles, perhaps because of the fluidity with which gender is treated in Hindu mythology. The popular Mohini myth has Shiva lusting after Vishnu in his female form; their union, depicted in images and temple reliefs as Harihara, even results in Vishnu giving birth to a son.

The most damaging notion that too much of India adheres to is that homosexuality is all about sex. This is the ultimate repudiation: Reducing same-sex relations to mere carnality strips them of legitimacy. The justices spent too much of their 98-page ruling wallowing in what offenses “against the order of nature” Section 377 might prohibit, before declaring that “it is difficult to prepare a list of acts which would be covered by the section.” (Shades of “I know it when I see it.”) They summarily dismiss the psychic wounds of gays who can engage in fulfilling relationships only under a pall of illegality.

This is the true goal of anti-gay laws: to deter not just homosexual conduct but, more perniciously, homosexual love. Indian society is particularly vested in the institution of heterosexual marriage, which often is arranged. Gay Indian children must withstand family pressure to get married and then seek physical release on the side. Besides the obvious health dangers, such unions can lead to intense shame and emotional suffering for gay men and lesbians and their unsuspecting spouses.

Whether the Indian government reverses this ruling or not, the renewed attention to Section 377 provides welcome visibility to these conflicts in Indian life and culture. Such coverage has proved beneficial since Section 377 was struck down in 2009 — by exposing citizens to the issue in newspaper articles and TV programs. Coming out in India’s closeted environment requires a great deal of courage, but the unfairness of this ruling may spur some individuals to stand up and be counted as a form of protest.

There is still much education to be carried out, a vast sea of minds to be changed. India needs to be reminded of its rich heritage of diversity, its historically liberal attitude toward variations in human behavior. The country will begin to accept its LGBT population only after it realizes that the quest for same-sex equality is about love, companionship and self-fulfillment much more than it is about sex.