California lawmakers oppose President Trump’s pledge to step up deportations. They’ve enacted three so-called sanctuary measures designed to make it harder for immigration officials to perform their missions. There’s a long history of states resisting unpopular federal policies. Abolitionist states like Pennsylvania actively thwarted the Fugitive Slave Act by throwing slave catchers in jail, while South Carolina “nullified” federal tariffs to protect its agrarian economy. On immigration, too, states have attempted to frustrate federal policy from both sides. During the Obama administration, Arizona passed a series of measures stricter than federal law and policy.

But while states have broad police power within their own jurisdictions, they can’t interfere with federal law, which the Constitution proclaims is the “supreme law of the land.” California’s three sanctuary policies, which Attorney General Jeff Sessions challenged in a new federal lawsuit last week, fall on both sides of this constitutional line. As strong supporters of federalism, we see U.S. v. California as an opportunity to restore constitutional order and resolve simmering tensions between federal and state powers.

The first challenged statute, styled the California Values Act, limits how state and local officials may cooperate with federal immigration officials. Absent a judicial warrant, law-enforcement agencies in California are forbidden to provide federal authorities with information about an alien’s release date. That prevents federal agents from taking custody of suspects at a secure facility, reducing the likelihood that the suspects will be caught and potentially putting federal officers in dangerous situations.

The Supreme Court held in Arizona v. U.S. (2012), which struck down some provisions of that state’s strict immigration law, that states can’t enact laws that interfere with Congress’s plenary power over immigration. And Mr. Sessions argues that the California Values Act defies a 1996 federal law that bars state and local governments from prohibiting the exchange of “information regarding” an individual’s immigration status.

The California Values Act, however, doesn’t interfere with federal law, because, as the Court recognized in Printz v. U.S. (1997), Congress can’t “commandeer” state officials. It is not a proper exercise of federal power to dictate how state law-enforcement agencies manage their resources and prioritize their missions. California’s policy of noncooperation no doubt makes enforcement more difficult, but it doesn’t constitute obstruction or interference.

The second sanctuary policy is harder to justify. It instructs California’s attorney general to inspect and review detention facilities, both public and private, “in which noncitizens are being housed or detained.” Obviously there’s no problem if California wants to inspect its own facilities, but the state exceeds its authority when it targets facilities run by the federal government or its contractors. States have the power to review federal facilities generally—for example, county health inspectors can check out the cafeteria in a federal courthouse. But they cannot burden a specific exercise of federal power with additional constraints.

Targeting federal agents for heightened scrutiny violates the so-called intergovernmental immunity doctrine. Two centuries ago, Maryland sought to impose a tax on a branch of the Second Bank of the United States. In the landmark case of McCulloch v. Maryland (1819), the Supreme Court held that Maryland had overstepped its authority. “The power to tax involves the power to destroy,” Chief Justice John Marshall wrote, and the state lacks the “power to control the constitutional measures” of the federal government, which the Constitution “declared to be supreme.”

Through his state’s novel regime, California Attorney General Xavier Becerra isn’t merely inspecting federal facilities in a neutral and consistent fashion, but, according to the federal government’s complaint, has “demanded access to various private documents respecting the ‘welfare of persons detained’ ” by the feds. To the extent that California is imposing additional burdens on federal immigration facilities—and no other federal properties—this second sanctuary law is unconstitutional.

The final challenged statute, the Immigrant Worker Protection Act, is the least likely to survive judicial scrutiny. Under this law, if a federal immigration officer informs a business owner that he employs a criminal alien, the proprietor is barred from consenting to a search of the premises. The state punishes the businessman with a substantial fine simply for being a good citizen, unless the federal agent compels cooperation by obtaining a warrant.

Critically, neither the Constitution nor federal law requires a warrant in such a scenario. California’s law applies only to immigration officers; proprietors remain free to consent to searches by federal environmental or health-and-safety inspectors, for example. Because the law interferes with a congressionally mandated mission, the Immigrant Worker Protection Act interferes with federal law. It is unconstitutional by virtue of both the Constitution’s Supremacy Clause and the intergovernmental immunity doctrine.

Under a federal structure that contemplates dual sovereignty, the national government should respect the spheres of state control, while states likewise should respect Washington’s constitutionally granted prerogatives. Resistance to unpopular federal laws—whether over tariffs or immigration, or marijuana, gambling, guns, or a host of other areas of possible conflict—is permissible only within the bounds of federalism.