On Tuesday, U.S. District Judge John D. Bates blocked the Trump administration’s attempt to rescind DACA, marking the third time a federal court has ruled against efforts to scrap the popular program, which has deferred deportation for 800,000 young undocumented immigrants. The reaction among conservative commentators was swift and severe. A National Review editorial condemned Bates’ decision as “extraordinarily dangerous judicial nonsense” and part of the “judicial #resistance.” Rich Lowry, writing in Politico, alleged Bates had “substitute[d] the logic of #resistance for common sense and the law.” These comments echoed the furious response to the previous two decisions preserving the Deferred Action for Childhood Arrivals program, which detractors similarly decried as acts of “judicial resistance,” ones possibly even meriting impeachment.

This narrative initially gained traction because the first two judges to block DACA’s rescission were left-leaning Democratic appointees. Its application to Bates, however, is laughable. A George W. Bush appointee, Bates cannot seriously be accused of liberal judicial activism; he is a deeply conservative and widely respected jurist who has never, in his 17 years on the bench, given any hint of partisan bias or impropriety. Bates’ thorough, fair-minded ruling undermines the partisan attacks on the decisions that preceded it. And it confirms that the individual most responsible for the continued survival of DACA is not a federal judge, but the man who tried to end the program: Attorney General Jeff Sessions.

Sessions is almost certainly Trump’s most effective and competent Cabinet member, but his attempt to rescind DACA was an uncharacteristically sloppy maneuver. Abolishing the program should have been easy. President Barack Obama created DACA via executive order, directing the Department of Homeland Security to allow a specific class of undocumented immigrants—young people brought to the U.S. unlawfully—to live and work here legally. To revoke DACA, Sessions need only put forth a clear statement explaining the constitutional, statutory, and policy justifications for discontinuing the program.

Instead, the attorney general issued a garbled one-page memo with minimal analysis. First, he suggested that DACA lacked “proper statutory authority.” Yet in 2014, the Office of Legal Counsel issued an opinion finding that DACA did have this statutory authority. Trump’s OLC could have reversed this finding, but it did not, and Sessions failed to explain why he’d ignore an opinion that remains on the books. This inconsistency undercut his claim, unsupported by any meaningful reasoning, that DACA had no statutory authorization.

Second, Sessions justified DACA’s rescission by pointing to a 5th U.S. Circuit Court of Appeals ruling striking down the Deferred Action for Parents of Americans and Lawful Permanent Residents program, or DAPA, a decision the Supreme Court summarily affirmed. He wrote that DACA “has the same legal and constitutional defects that the courts recognized as to DAPA,” suggesting that DACA, if allowed to proceed, would ultimately be invalidated, too.

This logic, too, is badly flawed. The Supreme Court’s DAPA decision was 4–4, leaving the 5th Circuit’s ruling in place but setting no precedent, so it cannot be cited as definitive proof that DAPA was unlawful. Moreover, DAPA is not DACA; it was a far broader program designed to aid a sweeping class of adult immigrants in a more permanent manner than DACA does. Even if DAPA were undoubtedly illegal (which it isn’t), that would not mean that DACA is illegal, too. Finally, the 5th Circuit did not find that DAPA had “constitutional defects,” as Sessions’ memo implies. In reality, the court did not address the program’s purported constitutional defects at all. This blunder was so conspicuous that the Justice Department had to acknowledge it in court.

Why did Sessions botch the rescission so badly? It’s a puzzling question. In the remarks he delivered the same day he announced DACA’s “wind down,” the attorney general said on camera what he declined to do in his memo, openly declaring his—and, by extension, the Trump’s administration’s—hostility toward DACA beneficiaries. These immigrants, Sessions asserted, had stolen jobs from “hundreds of thousands of Americans.” Policywise, that’s a terrible (and baseless) reason to kill the program. But at least it rests on the administration’s principles—unlike Sessions’ memo, which rests on contradictory and inaccurate legal claims.

Had Sessions stated in his memo that DACA conflicts with the current administration’s beliefs about immigration and executive power, it might’ve passed legal muster. By gesturing vaguely toward ambiguous case law instead, he made his decision vulnerable to court challenges. All three of the judges who’ve ruled to preserve DACA have said Sessions’ rescission violated the Administrative Procedure Act, which bars agency actions that are “arbitrary and capricious.” The first two explicitly found that DACA is legal, but Bates didn’t go that far. Rather, he pointed to the “scant legal reasoning” in Sessions’ memo, its “opaque” and “barebones” interpretation of the law, and its “fleeting” and “incongruous” references to precedent. The administration’s “egregious … failure to give an adequate explanation of its legal judgment,” Bates held, was sufficiently “arbitrary and capricious” to run afoul of the APA. He gave the administration 90 days to devise a better reason for rescinding the program.

And he held that if it cannot, the government must revive DACA entirely, renewing applications and accepting new applicants.

Bates’ decision is cautious and sensible—hardly the flagrant breach of judicial norms that Lowry and his cohorts have alleged. It exposes Sessions as the key roadblock to DACA’s revocation while giving the attorney general another chance to explain his decision. And it passes no judgment on the wisdom of DACA itself, focusing exclusively on the legal hurdles the administration must clear to end the program once and for all.

If anything, Bates’ ruling is exceedingly generous—not the product of “judicial resistance” but of a discerning judge interpreting the law and respecting the separation of powers. DACA’s opponents accuse Bates of imposing his political views on the administration in an effort to resist Trump. In reality, he gave Sessions a copy of Killing DACA for Dummies, gifting him a second chance to rescind the program without committing the amateurish errors that thwarted his first attempt.