Last week a U.S. District Court struck down President Trump’s executive order depriving sanctuary cities of federal funding. The judge’s order is full of the specious reasoning left-leaning judges have begun to use against the Trump administration, and goes out of its way to preserve a policy that directly harms the residents of many of America’s cities.

But in striking down the executive order, the court also preserves the doctrine of separation of powers and, perhaps without meaning to, strengthens the federalism that is essential to the system of American liberty. It reinforces the idea that while the states cannot nullify federal laws, the federal government cannot commandeer state law enforcement to enforce those laws, no matter how good the reason.

In that way, a bad ruling about a bad policy is good law, and good for America.

A President Is Not a King

The separation of powers within the government has been a part of the American system since its creation, and forms the most direct argument against Trump’s Executive Order 13768. As we all have (or should have) been taught in school, Congress makes the laws and the president enforces them. Although the rise of the administrative state has blurred this distinction, the president still cannot exercise powers he has not been granted by Congress or the Constitution.

In this case, Congress has passed legislation that grants money to various municipalities around the country, and the order purports to limit those grants to municipalities that do not obstruct federal enforcement of immigration laws. Specifically, it directs the relevant federal officials “in their discretion and to the extent consistent with law, shall ensure that [sanctuary jurisdictions] are not eligible to receive Federal grants, except as deemed necessary for law enforcement purposes by the Attorney General or the Secretary.”

For centuries, presidents have tried to avoid spending money that Congress has lawfully appropriated. Courts have repeatedly struck them down, most prominently in the 1975 case of Train v. City of New York, in which the Supreme Court held that where Congress did not give the president discretion on distributing funds, he may not create that discretion himself. Simply put, when the law says the federal government will spend some amount of money, the president cannot decide that it won’t. (Professor Ilya Somin has written more on this point recently in The Washington Post).

Separation of powers sometimes slows down the government or obstructs the executive entirely, but there are good reasons for it. The executive’s job is, as the Constitution says, to “take care that the laws be faithfully executed.” We separate that power from the legislative power to avoid too much authority falling into one person’s hands. If the president could withhold funds or strike down laws without restriction, the executive would have usurped the powers of the legislature. We would have a king, not a president.

Congress could resolve the separation of powers problem for future appropriations fairly easily by adding language to the statute that grants the president the discretion he claims to have. That would be in keeping with Congress’s decades-long abdication of responsibility to the executive, as they pass vague laws to please their constituents and leave the unpopular and arduous task of working out the nitty-gritty details to the bureaucrats. But even that action would not resolve the larger issue of federalism and nullification.

A History of Nullification

States and the federal government have been fighting over power since the ink dried on the Constitution. In the early days of the republic, a theory became fashionable that states had the power to ignore federal laws. Passing a bill to that effect—nullifying the law, in the jargon of the times—various states sought to reject the power of the federal government and preserve the far-reaching sovereignty they had only recently relinquished by ratifying the Constitution.

In the Virginia and Kentucky resolutions (secretly authored by future presidents Thomas Jefferson and James Madison), states claimed the right to declare unconstitutional any act of Congress that they believed exceeded the federal government’s delegated authority. The northern and border states rejected this view, but many in New England reconsidered the idea when they wished to reject the Embargo Act of 1807, which harmed their trade with Great Britain and was unpopular in the region. Like a lot of theoretical principles, nullification becomes more popular when it aligns with one’s preferred course of action.

Neither attempt gained much traction, but the theory led, a generation later, to what has become known as the Nullification Crisis. Congress in 1828 raised the nation’s protective tariffs. This made President John Quincy Adams’s administration even more unpopular in the South, a stronghold of his opponent, Andrew Jackson. Jackson defeated Adams for reelection that year, but the tariff, known in the South as the “Tariff of Abominations,” remained the law of the land. South Carolina held a state convention declaring the tariff void within the borders of the state.

President Jackson’s star has been falling in the twenty-first-century firmament, but among Old Hickory’s enduring virtues was an unwillingness to brook any attempt to diminish the power or permanence of the federal union. In 1833, Congress authorized Jackson to deploy troops to enforce federal laws, and South Carolina knew better than to doubt him. The state convention reconvened and quietly repealed the nullification order.

The next generation saw further discord culminating in Civil War. There was an echo of nullification in the North as abolitionists sought to evade or ignore the Fugitive Slave Act of 1850, which forced their complicity in returning escalated slaves to bondage. The sectional tension mounted, and what legal and political argument could not decide was resolved on the fields of Shiloh, Gettysburg, and Appomattox.

Secession was dead. But the idea of nullification, effectively a lesser included offense of secession, did not go quietly. As Reconstruction faded and federal troops pulled out of Southern capitals, Southern legislatures began to ignore federal civil rights laws, largely with the acquiescence of Congress, which cut funds for the laws’ enforcement.

As the civil rights movement gained steam, nullification returned with open defiance of federal authority. When Arkansas governor Orval Faubus stood in the schoolhouse door to resist desegregation, he lacked Calhoun’s veneer of legal justification, retaining only the stubborn refusal to obey federal law. President Dwight Eisenhower’s response was the same as Jackson’s had been, and federal troops oversaw integration and the end of another nullification crisis.

Separate Sovereignties Means Separate Enforcement

In recent years, though, the expansion of federal power—and spending—has shifted the question. The old debate centered on whether the federal government had the right to legislate in an area; now, the large amount of money transferred from Washington to states and localities every year has become a cudgel to force local governments to do the feds’ bidding. The modern version of nullification involves states trying to preserve their sovereignty—while still hanging on to that federal money, of course.

The large amount of money transferred from Washington to states and localities every year has become a cudgel to force local governments to do the feds’ bidding.

Courts once took it as a given that this was legal, but have since narrowed the federal government’s power to blackmail states with their own taxpayers’ money. As Ilya Shapiro wrote here at The Federalist, there are several rules, the most important of which here is that the “conditions can’t be coercive. Once a state has signed onto a program, Congress can’t later add new major strings that would transform the original program. This was the ‘undercard’ ruling in NFIB v. Sebelius (the first Obamacare case, where the Supreme Court ruled 7-2 that the Affordable Care Act unconstitutionally threatened existing, not just new, Medicaid funds on new requirements).”

The federal government has grown so expansively in the past few decades that the new nullifiers now have the better of the argument. No one doubts that the federal government has jurisdiction over immigration. Whether they can force the states to help them enforce immigration laws is another matter. In Printz v. United States in 1997, the Supreme Court ruled that the Tenth Amendment barred the federal government from requiring state employees to enforce federal firearms background check laws.

This is exactly what many sanctuary city opponents prescribe as the cure: forcing state and local law enforcement to apply federal immigration laws. As in the Printz case, this is contrary to the idea of federalism and local control of government. The local jurisdictions challenging Trump’s executive order do not seek to nullify the federal authority on the subject; they merely object to Washington’s right to conscript their employees to enforce it.

The best solution would be for states to voluntarily tip off the feds to criminals in their midst. But in jurisdictions where the local governments value virtue signaling more than their citizens’ safety, the answer is for Washington to hire more enforcement officers and do the job themselves.

If Congress is not willing to appropriate the funds for that, it should signal to voters that they are not serious about solving the problem they talk so much about. Congress and the Trump administration have properly identified sanctuary cities as something that needs to be fixed. Now they must put their money where their mouths are, while staying within the law.

Kyle Sammin is a lawyer and writer from Pennsylvania. Read some of his other writing at kylesammin.com, or follow him on Twitter @KyleSammin.