On June 27, 2007, O'Connor was nominated by President George W. Bush to a seat on the United States District Court for the Northern District of Texas vacated by A. Joe Fish. The United States Senate confirmed O'Connor's appointment on November 16, 2007, and he received his commission on November 21, 2007.
Significant cases
O'Connor has widely been described as conservative. O'Connor has become a "go-to" favorite for conservative judicial activists, as he tends to reliably rule against Democratic policies. Attorneys General in Texas appear to strategically file cases in O'Connor's jurisdiction so that he will hear them. On August 21, 2016, O'Connor issued a ruling against the Obama administration dealing with the government's interpretation of Title IX rules. The guidance from the White House was issued in May 2016, and addresses the Title IX requirement that schools receiving federal funding not discriminate against students on the basis of sex. The ruling required that transgender students be allowed to use the bathroom that corresponds to their gender identity. O'Connor ruled that the new guidelines did not receive proper notice and comment prior to publication, and that Title IX and its implementing regulation are "not ambiguous" as to the "plain meaning of the term sex as used". He then issued a nationwide injunction preventing them from being enforced with respect to students' access to "intimate facilities." On December 31, 2016, in a separate case, O'Connor issued a preliminary injunction against enforcement of the Obama administration’s regulations implementing Section 1557 of the Affordable Care Act as a likely violation of the Religious Freedom Restoration Act and what he said was an improper inclusion of gender identity discrimination. On October 5, 2018, O'Connor ruled that the Indian Child Welfare Act was unconstitutional.
Affordable Care Act
On December 14, 2018, O'Connor ruled that the Affordable Care Act was unconstitutional. O'Connor ruled that the individual mandate was unconstitutional by saying " Individual Mandate can no longer be fairly read as an exercise of Congress's Tax Power and is still impermissible under the Interstate Commerce Clause—meaning the Individual Mandate is unconstitutional." This is in reference to National Federation of Independent Business v. Sebelius which ruled that the individual mandate was constitutional because of the tax penalty. The penalty was reduced to $0 by the 2017 tax bill starting in 2019. The ruling was deemed likely to be appealed, with both Republican and Democratic legal experts saying that the legal challenge to the Affordable Care Act was unlikely to succeed. The Affordable Care Act would remain in effect throughout the appeals process. President Donald Trump commended the ruling on Twitter. Legal experts who both support and oppose the Affordable Care Act harshly criticized O'Connor's ruling, with The Washington Post noting that legal scholars considered O'Connor's ruling "as a tortured effort to rewrite not just the law but congressional history." Ted Frank, director of litigation at the conservative Competitive Enterprise Institute said the ruling was "embarrassingly bad." Nicholas Bagley said O'Connor's ruling was "about as naked a piece of judicial activism as I have ever seen; I don’t even think it’s close." Jonathan H. Adler and Abbe R. Gluck, who were on opposing sides of the 2012 and 2015 Supreme Court challenges to the Affordable Care Act, wrote a joint opinion editorial in The New York Times where they described the ruling as "lawless", "a mockery of the rule of law and basic principles of democracy" and "an exercise of raw judicial power."