Texas, Wisconsin, Nebraska, Kentucky, Kansas and physicians’ groups Franciscan Alliance, Specialty Physicians of Illinois and Christian Medical and Dental Associations sued the U.S. Department of Health and Human Services on Aug. 23 in Federal Court, claiming the determination of gender under the law has become a “state of mind” instead of a “biological fact.”

They claim it violates the “medical judgment and conscience rights” of doctors, who could be forced to perform sex-reassignment surgeries.

Judge O’Connor concluded that the rule change “places substantial pressure on plaintiffs to perform and cover and transition and abortion procedures.”

“Private plaintiffs’ long-held view that such procedures are immoral and inappropriate in every circumstance is now at odds with the rule’s interpretation of sex discrimination because it requires them to remove the categorical exclusion of transitions and abortions (a condition they assert is a reflection of their religious beliefs and an exercise of their religion) and conduct an individualized assessment of every request for those procedures,” the 46-page opinion states.

Citing the U.S. Supreme Court’s 2014 ruling in Burwell v. Hobby Lobby, O’Connor wrote: “A law that ‘operates so as to make the practice of … religious beliefs more expensive’ in the context of business activities imposes a burden on the exercise of religion. Accordingly, the Rule imposes a substantial burden on private plaintiffs’ religious exercise.” (Citing the U.S. Supreme Court ruling in Braunfeld v. Brown, 366 U.S. 599, 605 (1961)).

O’Connor says the federal government has “numerous less restrictive means available to provide access and coverage for transition and abortion procedures” and failed to show how exempting private plaintiffs’ religious beliefs would “frustrate the goal of ensuring ‘nondiscriminatory access to health care and health coverage.’”

Texas Attorney General Ken Paxton said Sunday the rule change would be costly to states as it would force the Employees Retirement System of Texas to cover gender-reassignment and abortion procedures for its 500,000 participants. He said a doctor who morally objects to the procedures and refers a patient to another doctor may violate the rule.

“This striking example of federal overreach under Obamacare would force many doctors, hospitals and other health care providers in Texas to participate in sex-reassignment surgeries and treatments, even if it violates their best medical judgment or their religious beliefs,” Paxton said in a statement.

Ezra Young, at attorney with the Transgender Legal Defense and Education Fund, said he expected O’Connor to be reversed on appeal to the Fifth Circuit.

“Judge O’Connor’s conclusion that transgender people and persons who have had abortions are somehow excepted from protection is deeply troubling, legally specious, and morally repugnant,” Young said Saturday.

O’Connor ruled four months after he blocked an earlier Obama administration order to allow transgender students to use bathrooms and locker rooms consistent with their gender identity.

Texas, 12 other states and two school districts had challenged the measure that allowed students to disregard the gender listed on their birth certificate and use the restroom of the sex with which they identified.

Judge O’Connor, 51, was appointed to the federal bench by President George W. Bush on June 27, 2007 and approved by the Senate on Nov. 16 that year.