WASHINGTON — Nearly all of the Supreme Court's recent rulings on hot-button social issues come out 5-4, so Monday's 6-3 vote declaring that employers can't fire workers for being gay or transgender is stunning enough.
Even more surprising is that the majority opinion was written by President Donald Trump's first appointee to the court — Neil Gorsuch. Trump's more recent pick, Brett Kavanaugh, sided with the court's two other dissenters, Clarence Thomas and Samuel Alito.
Gorsuch came to the court after Antonin Scalia died in 2016, and Kavanaugh succeeded Anthony Kennedy, who — until Monday — had written all of the court's gay rights rulings until he retired in 2018.
"The LGBT community was panic-stricken that the retirement of their hero, Justice Kennedy, would cause them to suffer a huge setback in the Supreme Court. Instead, it's a massive victory," said SCOTUSblog publisher Tom Goldstein, a Washington, D.C., lawyer who argues frequently before the court.
"The irony here is that the most conservative Trump appointee writes the sweeping opinion, while Kavanaugh, who the left had more hopes for, is with the dissenters," Goldstein added.
Chief Justice John Roberts assigned Gorsuch the task of writing the opinion, perhaps to underscore that it is meant to be based on a strict reading of the law — the Civil Rights Act of 1964, which bans job discrimination because of race, religion and sex, among other factors.
Undoubtedly, Gorsuch said, Congress wasn't thinking about sexual orientation or gender identity when it wrote the law 56 years ago. But it's the words of the law that matter, not what Congress had in mind.
"It is impossible to discriminate against a person for being homosexual or transgender without discriminating against that person based on sex," he wrote. If a boss fires a man for being attracted to other men, Gorsuch continued, then "the employer discriminates against him for traits or actions it tolerates in his female colleague."
Gorsuch notes that his predecessor, Scalia, also said laws had consequences that Congress might not have considered when it passed them.
For example, Scalia ruled in favor of a man who was sexually harassed by other men on an offshore oil rig. Lower courts said only actions by members of the opposite sex could be considered illegal harassment, but Scalia said not so. The worker would have been treated differently if he'd been a woman, so that was sex discrimination.
Monday's ruling was roundly criticized by conservative friends of Gorsuch, as he undoubtedly knew it would be. Carrie Severino, a former clerk for Thomas, said, "Justice Scalia would be disappointed that his successor has bungled textualism so badly today for the sake of appealing to college campuses and editorial boards."
Alito was scathing in his dissent, calling the ruling "preposterous," a form of legislating in the guise of a court decision.
"The question in these cases," he wrote, "is not whether discrimination because of sexual orientation or gender identity should be outlawed. The question is whether Congress did that in 1964. It indisputably did not."
Download the NBC News app for breaking news and politics
Dissenting separately, Kavanaugh agreed that the ruling crossed over the line separating the branches of government. But his opinion lacked any bitterness.
In summing up, he added: "Millions of gay and lesbian Americans have worked hard for many decades to achieve equal treatment in fact and law. ... They have advanced powerful policy arguments and can take pride in today's result."