The ruling reverses a landmark judgment by a lower court, which in 2009 decided that an 1861 law that forbids “carnal intercourse against the order of nature with man, woman or animal” was unconstitutional. The law, passed by the British, makes homosexuality punishable by 10 years in prison. Only Parliament can change that law, the Supreme Court ruled.The NYT quote I've put in the headline is a bit inaccurate — probably willfully so — in saying that "homosexuality" is illegal. It's homosexual intercourse that is banned, not the status of having a homosexual orientation. But those who want equality for gay people frequently elide this connection. In the American case dealing with homosexual conduct, Justice O'Connor, concurring, made the connection openly:
There is almost no chance that Parliament will act where the Supreme Court did not, advocates and opponents of the law agreed. And with the Bharatiya Janata Party, a conservative Hindu nationalist group, appearing in ascendancy before national elections in the spring, the prospect of any legislative change in the next few years is highly unlikely, analysts said.
Texas argues... that the sodomy law does not discriminate against homosexual persons. Instead, the State maintains that the law discriminates only against homosexual conduct. While it is true that the law applies only to conduct, the conduct targeted by this law is conduct that is closely correlated with being homosexual. Under such circumstances, Texas’ sodomy law is targeted at more than conduct. It is instead directed toward gay persons as a class. “After all, there can hardly be more palpable discrimination against a class than making the conduct that defines the class criminal.” [Romer v. Evans, 517 U.S.] at 641 (Scalia, J., dissenting) (internal quotation marks omitted). When a State makes homosexual conduct criminal, and not “deviate sexual intercourse” committed by persons of different sexes, “that declaration in and of itself is an invitation to subject homosexual persons to discrimination both in the public and in the private spheres.”