How does it feel to have your papers out of order, Mr. Kobach?

Of course, restrictive voting laws like these have never been about protecting electoral integrity. They’re about keeping certain people away from the ballot box, often based on who they are — or are assumed to be. On Tuesday, one of Mr. Kobach’s witnesses, a political scientist, Jesse Richman, testified that up to 18,000 noncitizens have registered or tried to register in Kansas. When the A.C.L.U.’s lawyer asked him about his methods for analyzing the state’s list of suspended voters, Mr. Richman said that, among other things, he flagged foreign-sounding names. What about a name like “Carlos Murguia,” the lawyer asked. Would he flag that one? Yes, Mr. Richman said. He was then informed that Carlos Murguia is a federal district judge who sits in the courthouse where the trial is being held.

It all seems like a big joke until you remember that laws like these have already had their intended effect. In Kansas, more than 22,000 people who tried to register had their applications suspended or canceled for not having proof of citizenship. And in Wisconsin, which President Trump won by fewer than 23,000 votes, a strict voter-ID law kept at least 17,000 voters from the polls in 2016.

Remember also that just days after the 2016 election, Mr. Kobach scored a meeting with President-elect Trump in which he urged the passage of a nationwide proof-of-citizenship requirement. A few months later, Mr. Trump appointed Mr. Kobach to lead his so-called election integrity commission. In January, after months of futility and infighting, the commission folded, having made no findings and issued no recommendations. No surprise there — there’s virtually nothing to find. There has been no epidemic of noncitizens voting, despite Mr. Trump’s baseless claim (endorsed by Mr. Kobach) that he lost the popular vote only because of millions of illegal voters. And there are hardly any examples of in-person voter fraud, the only kind that could conceivably be stopped by voter-ID laws. A federal judge once compared such laws to using “a sledgehammer to hit either a real or imaginary fly on a glass coffee table.”

Unfortunately, the courts have not always brought the appropriate degree of skepticism to these laws. The Supreme Court upheld the first voter-ID law it considered, in 2008, even though the Indiana lawmakers who passed it had not identified a single case of fraud that the law would have prevented. Former Justice John Paul Stevens, who wrote the opinion in that case, later called it a “fairly unfortunate decision.” Richard Posner, a former federal appeals court judge who also upheld the Indiana law, later said that voter-ID laws are “now widely regarded as a means of voter suppression rather than of fraud prevention.”

More recently, courts have gotten better about questioning the evidence and rationale for these laws, striking down some of the strictest ones, in Texas and North Carolina, for deliberately discriminating against minority voters. That’s the right approach. These laws masquerade as common-sense measures, but they are in truth anti-democratic shams, and it is gratifying to see them unravel in the harsh light of a federal courtroom.