On immigration, Republicans long ago sold their souls and humanity for political gain. But in the wake of the recent shooting death of a 31-year-old California woman by an undocumented Mexican worker in San Francisco, it's become obvious that Democrats are really no different.

Sen. Dianne Feinstein (D-Calif.) and Democratic presidential frontrunner Hillary Clinton could have used the tragedy

as a teachable moment about the insanity that is America's immigration system. Instead, they have thrown San Francisco's sanctuary polices, which help shield illegal immigrants from massively unfair federal policies, under the bus faster than anyone could say "adios."

Anti-immigration hysterics on the right are spinning this rather bizarre episode involving a rather bizarre man (who says he was under the influence of sleeping pills that he found in a dumpster when he shot the woman—with a gun he found on a bench wrapped in a T-shirt—thinking he was shooting sea lions!) as a simple morality tale against so-called sanctuary cities that are thwarting federal efforts to deport dangerous criminals. In conservatives' telling, the alleged shooter in this case, Juan Francisco Lopez-Sanchez, was a convicted felon whom San Francisco knowingly released on the streets to thumb its nose at Uncle Sam's request to detain him. Donald Trump, who jumped on the incident as a vindication of his ugly comments that Mexicans coming to America were rapists and criminals, taunted other candidates on Twitter, asking them where they were "now that this tragic murder has taken place b/c of our unsafe border."

This is a horrible caricature of a tragic situation. Far more depressing, however, is that Feinstein and Clinton should take the bait.

Feinstein, who has long posed as a friend of immigration and Latinos, denounced San Francisco, and scolded it to join the federal Priority Enforcement Program—apparently unaware of the fact that San Francisco has joined this program for the simple reason that it is mandatory. And Clinton, who during her previous presidential run had strongly (and rightly) condemned a federal crackdown on sanctuary cities such as San Francisco, has now declared that she has "absolutely no support" for a city that defies federal deportation rules.

This whole characterization is nonsense. The notion that a city would willfully release a dangerous felon—citizen or immigrant, legal, or illegal—simply to spite Uncle Sam is totally ludicrous. So what exactly did happen?

There is no doubt that Sanchez-Lopez is a serial border jumper who was convicted several times for illegal entry into the United States and a few times for drug possession. He was imprisoned on multiple occasions—sometimes for years—and at the end of his term, deported, only to hop back over again. But he had no convictions for any violent crimes. Most recently, he served a sentence in a California federal prison for unlawful entry, and then was handed over to the San Francisco sheriff for an old warrant for marijuana possession and sale. He was soon released, in part because ICE (Immigration and Customs Enforcement) issued an unconstitutional detention request to the sheriff, and not a warrant, as required by local law, notes Chris Newman, legal director of the National Day Laborer Organizing Network.

Conservatives—and now leading Democrats—are demagogically pinning the blame on this "sanctuary" policy. That's simply inaccurate. But more important, it glosses over the enormous problems with federal immigration policy.

The first sanctuary policy arose during the 1980s, when churches offered refuge to people fleeing violence from Central America who were having trouble obtaining asylum. In recent years, about 200 cities have resorted to them to protect their residents from illicit federal demands.

For example, under the Bush administration's SECURE communities program—which the Obama administration was forced to reform and roll into PEP—local authorities were not only required to share biometric information with ICE regarding everyone—citizen and immigrant—booked for even minor infractions, but then detain them till ICE issued a ruling whether they were in the country legally or not. This meant that citizens and legal residents brought in for anything ended up effectively under arrest without probable cause or a warrant or a criminal conviction, often for periods of time longer than warranted by the infraction for which they were brought in.

Federal courts have repeatedly ruled that such detentions are an unconstitutional violation of due process rights. But that is not their only problem. They warp local enforcement priorities, forcing municipalities to detain and hold peaceful undocumented workers who pose no threat to anyone. Equally reprehensible, they pit local police departments against their own communities, especially in Latino-dominated neighborhoods. Numerous times, undocumented immigrants who showed up at police departments to report serious crimes like theft and rape have themselves ended up getting detained and deported, breeding fear and suspicion among Latinos, many of whom stopped cooperating with local police in apprehending genuinely dangerous drug cartel or gang members.

Admittedly, sanctuary policies try and strike a fine balance between protecting the constitutionally guaranteed rights of citizens and immigrants and the needs of law enforcement. But cities would have no need to walk this tightrope if Congress would just fix the broken immigration system, legalize the existing unauthorized population, and stanch the stream of future illegal immigrants by creating a workable guest worker program with Mexico. If the vast majority of these workers could work and live in the country legally, it would make it much, much easier to deal with the Sanchez-Lopezes of the world.

But instead of using this tragic act by a disturbed man to expose these broader problems, Feinstein and Clinton jumped on the Donald Trump bandwagon to demagogue the issue. It is bad enough that this man's vitriol is ruining the Republican Party. That it is also poisoning Democrats on this issue is downright deplorable.

This column originally appeared in The Week.