President Donald Trump’s health care agenda keeps running aground, again and again, in the courts.

Unable to pass a health care bill in Congress, the Trump administration decided to use regulations to roll back the Affordable Care Act and reshape Medicaid. But those plans have been blocked repeatedly by the judiciary. This week alone, federal judges ruled against Medicaid work requirements and association health plans, two signature Trump proposals.

Some of the losses have come on technical grounds, with judges chastising the administration for pushing through new regulations without properly accounting for their consequences or public comments on the proposals. But more fundamentally, the Trump administration has been so aggressive in its regulations on health care that the courts have decided they are actually violating federal law.

“They’re pushing the boundaries on what is legally acceptable while not doing themselves any favors on the process,” Katie Keith, a Georgetown University law professor who follows health care litigation, told me. “The courts care more about what the policies do than what the administration says they do. As a result, they’re concluding the policies are unlawful.”

Association health plans, which were supposed to allow small businesses and self-employed people to buy insurance that doesn’t comply with the ACA’s rules, were struck down in a Thursday court ruling on those grounds. District Judge John Bates, a George W. Bush appointee, concluded the Trump proposal was “an end-run” around the 2010 health care law that also “does violence” to ERISA, the federal statute governing employer health plans.

“The Final Rule was intended and designed to end run the requirements of the ACA, but it does so only by ignoring the language and purpose of both ERISA and the ACA,” he wrote.

Trump policies have fallen over and over again in court: Medicaid work requirements, association health plans, the rollback of Obamacare’s contraception mandate, and an end to key ACA subsidies for health insurers. Appeals are continuing, but Trump’s ability to reshape US health care has been seriously hobbled by his administration’s inattentiveness to the law.

Association health plans and Medicaid work requirements have stalled out in court

Trump entered office claiming he would be an unorthodox Republican on health care, promising insurance for everyone and swearing off Medicaid cuts. But in practice, he has endorsed GOP plans to cut health care and empowered agency leaders who want to curtail federal health care programs.

With the repeal bills dead, Trump officials tried to achieve the same goals of their unsuccessful legislative agenda through administrative authority instead. They proposed aggressively expanding association health plans, which allow businesses to band together to buy insurance and aren’t subject to the health care law’s rules for preexisting conditions.

Bates, in his ruling blocking the regulations, castigated the Trump administration for its “absurd” interpretations of the ACA and ERISA, the law that sets federal rules for employer health insurance. He ripped the administration for permitting businesses to pool together even if they had no direct business connections beyond geography and for allowing self-employed people to join these associations meant for employers. He portrayed the rules as a thinly disguised “end run” around Obamacare that ended up running afoul of both federal laws at the same time.

“DOL’s explanation of how the Final Rule operates under the ACA relies on a tortured reading of the ACA’s statutory text that undermines the market structure that Congress so carefully crafted,” he wrote. “DOL’s regulatory interpretation sows discord among the Final Rule, ERISA, and the ACA, which serves as further evidence that the Final Rule unreasonably interprets ERISA and fails to carry out congressional intent.”

Likewise, Republicans in Congress tried, but failed, to repeal Obamacare’s Medicaid expansion and place spending caps on Medicaid. Conservatives still oppose the ACA’s expansion of Medicaid, though, so the administration has tried to use work requirements to roll it back. In all of the states that have had a work requirement approved by the administration, childless, nondisabled adults who have been the primary beneficiaries of Medicaid expansion would be required to work to continue receiving their benefits. Coverage for other Medicaid recipients could be at risk, too, under some of the states’ proposals.

But work requirements, which were quickly challenged in court, had one big legal vulnerability: The Medicaid program is explicitly charged with providing health insurance to low-income Americans. Work requirements were expected to result in people losing health coverage in Arkansas, Kentucky and the other states that have asked the administration for permission to institute such a requirement.

And twice now, they have been blocked by Judge James Boasberg because the administration had not adequately considered that approving a work requirement was likely to lead to people losing Medicaid benefits, in direct violation of Medicaid’s statutory aim. He noted several times that public and expert comments had warned the administration of the risks to coverage, but HHS approved the proposals anyway.

“Even putting to one side the agency’s affirmative obligations to address coverage loss, however, the Secretary unquestionably has a duty to consider that issue where multiple commenters provide credible forecasts that it will occur,” Boasberg wrote this week. “Here, as has been said, the agency ... neglected that duty.”

So Trump’s plans to loosen insurance regulations and pull back Medicaid expansion have lost in court. Next up could be the president’s expansion of short-term insurance plans, which are also not subject to Obamacare’s rules on preexisting conditions. Oral arguments in a lawsuit challenging those regulations are expected in the coming months.

Trump’s moves on the contraception mandate and cost-sharing reductions also lost legal battles

One of Trump’s other major regulatory maneuvers was unwinding the ACA’s requirement that almost all insurance plans cover contraception free of charge. The administration has proposed allowing even major for-profit businesses to refuse to cover birth control for their workers. But that plan has also been stopped by the federal courts.

In a repeat of the pattern seen on Medicaid work requirements, Trump’s rollback of the contraception mandate first fell on procedural grounds. The administration had wanted the rules to take immediate effect, which the courts said was not permissible because there usually is a period of time given for notice and comment on pending regulations.

But in the most recent rulings, the administration was once again reamed by a federal judge for promulgating a rule in direct defiance of the law — the ACA itself in this case.

“Congress has already answered who must provide preventive care coverage: any ‘group health plan’ or ‘health insurance issuer offering group or individual insurance coverage,’” Judge Wendy Beetlestone, an Obama appointee, wrote in a January decision blocking the Trump regulations nationwide. “To permit the agencies to disrupt this mandate contradicts the plain command of the text.”

There is another wonkier issue on which Trump has suffered a loss in the court: cost-sharing reductions. Those subsidies established by Obamacare are paid to health insurers to compensate them for reducing out-of-pocket costs for their lower-income customers. Trump decided to cut the payments off, arguing Congress had not approved the necessary spending despite their establishment in the ACA itself.

Insurers have sued, arguing the government is reneging on the payments promised in Obamacare. They have won in every case, according to Keith’s coverage in Health Affairs:

To my knowledge, every CSR case that has been decided so far has been won by insurers. As Judge Thomas C. Wheeler put it in his decision in L.A. Health Care Plan, insurers “should not be left ‘holding the bag’ for taking our government at its word.”

Those rulings are being appealed by the administration. But once again, in its bid to undermine the ACA, Trump has found himself at odds with the courts for disregarding his statutory obligations.

Even Trump’s one big legal success attacking Obamacare has come under fire

There is one lawsuit where Trump’s side has prevailed: the legal challenge by Texas and other conservative states, now supported in full by the administration, to overturn the ACA entirely.

But the Texas lawsuit has been harshly criticized by even right-leaning legal scholars and some Republican senators for the absurdity of its legal arguments and the consequences if the lawsuit prevails and millions of people lose coverage.

And other legal experts have warned about the dangerous dereliction of duty shown by the Justice Department in refusing to defend the federal law in court.

“The Justice Department has trashed the duty to defend. That’s not to be taken lightly. The duty is a close cousin to the president’s constitutional duty to enforce the law,” Nicholas Bagley, a University of Michigan law professor, wrote in a New York Times op-ed this week. “If the Justice Department really thinks that Obamacare is so blatantly unconstitutional that it can’t be defended, that implies that the president is violating the Constitution whenever he applies it.”

The conservative states argue that because the Republican Congress repealed the individual mandate penalty in the 2017 tax law, removing the provision that Chief Justice John Roberts used in 2012 to justify upholding the law’s constitutionality, the entire law must now fall under Roberts’s theory. Legal scholars on the left and the right have said it’s a ridiculous case; Congress amends laws all the time, and the earlier Congress decided to repeal the mandate penalty while preserving the rest of the law. It’s legally vacuous to try to now apply Roberts’s old logic to a newly amended law.

A senior career Justice Department attorney also resigned following the administration’s decision not to defend the health care law, as the Washington Post reported last June. Back then, the Justice Department was “only” arguing the rules protecting preexisting conditions should fall. But it still drew the ire of Republican senators.

“The Justice Department argument in the Texas case is as far-fetched as any I’ve ever heard,” Sen. Lamar Alexander (R-TN) said last summer. But the administration has since raised the stakes considerably, embracing the states’ argument that the entire health care law should be invalidated.

The consistent theme is that the Trump administration has shown an utter disregard for the federal statutes it is charged with enforcing, all in the pursuit of a health care agenda that would roll back benefits for millions of people. Some legal scholars have argued that Trump has been so cavalier in undercutting Obamacare through his executive authority that he is violating a constitutional mandate that the president “take care” in faithfully executing the federal laws.

“If the president exercises his discretion to further the purpose of a statute, he complies with the take care clause. If he uses his power pretextually or unreasonably, he violates the Constitution,” Abbe Gluck, a Yale law professor, wrote for Vox in 2017. “The president has a right not to like the ACA. But so long as it is the law of the land, he does not have the right to undermine it through the use of executive power.”

Thus far, the courts have served as an aggressive check on Trump. But the fight isn’t over.