In a stunning surprise, the U.S. Supreme Court ruled that LGBT workers are protected by the Civil Rights Act. In the biggest surprise, the decision was 6-3 and was written by Trump appointee Neil Gorsuch.

What a nice surprise for Pride Month!

Adam Liptak of the New York Times wrote:

The Supreme Court ruled Monday that a landmark civil rights law protects gay and transgender workers from workplace discrimination, handing the movement for L.G.B.T. equality a stunning victory.

The vote was 6 to 3, with Justice Neil M. Gorsuch writing the majority opinion. He was joined by Chief Justice John G. Roberts Jr. and Justices Ruth Bader Ginsburg, Stephen G. Breyer, Sonia Sotomayor and Elena Kagan.

The case concerned Title VII of the Civil Rights Act of 1964, which bars employment discrimination based on race, religion, national origin and sex. The question for the justices was whether that last prohibition — discrimination “because of sex”— applies to many millions of gay and transgender workers.

The decision, covering two cases, was the court’s first on L.G.B.T. rights since the retirement in 2018 of Justice Anthony M. Kennedy, who wrote the majority opinions in all four of the court’s major gay rights decisions.

Those decisions were grounded in constitutional law. The new cases, by contrast, concerned statutory interpretation.

Lawyers for employers and the Trump administration argued that the common understanding of sex discrimination in 1964 was bias against women or men and did not encompass discrimination based on sexual orientation and gender identity. If Congress wanted to protect gay and transgender workers, they said, it could pass a new law.

Lawyers for the workers responded that discrimination against employees based on sexual orientation or transgender status must as a matter of logic take account of sex.

The court considered two sets of cases. The first concerned a pair of lawsuits from gay men who said they were fired because of their sexual orientation. The second was about a suit from a transgender woman, Aimee Stephens, who said her employer fired her when she announced that she would embrace her gender identity at work.

The cases concerning gay rights are Bostock v. Clayton County, Ga., No. 17-1618, and Altitude Express Inc. v. Zarda, No. 17-1623.

The first case was filed by Gerald Bostock, a gay man who was fired from a government program that helped neglected and abused children in Clayton County, Ga., just south of Atlanta, after he joined a gay softball league.

The second was brought by a skydiving instructor, Donald Zarda, who also said he was fired because he was gay. His dismissal followed a complaint from a female customer who had expressed concerns about being strapped to Mr. Zarda during a tandem dive. Mr. Zarda, hoping to reassure the customer, told her that he was “100 percent gay.”

Mr. Zarda died in a 2014 skydiving accident, and his estate pursued his case.

Most federal appeals courts have interpreted Title VII to exclude sexual orientation discrimination. But two of them, in New York and Chicago, have ruled that discrimination against gay men and lesbians is a form of sex discrimination.

In 2018, a divided 13-judge panel of the United States Court of Appeals for the Second Circuit, in New York, allowed Mr. Zarda’s lawsuit to proceed. Writing for the majority, Chief Judge Robert A. Katzmann concluded that “sexual orientation discrimination is motivated, at least in part, by sex and is thus a subset of sex discrimination.”