So imagine: It’s Nov. 4, 2020. Swarms of people have voted by mail for the first time, many of them incorrectly. State election officials are struggling to keep up with the deluge. The presidential race is tight, with Donald Trump or Joe Biden (pick your poison) leading nationally by 500,000, similar to the popular vote in 2000. But something like a million mail-in ballots have been thrown out.

The Electoral College comes down to Ohio and Wisconsin, where the contenders are separated by several thousand votes. For 10 days, late ballots keep being counted in Ohio. As voters race to fix bad signatures, it sets off a scramble of challenges and counter-challenges. Mr. Biden files a lawsuit pointing to higher rates of ballot rejection in areas with more black voters. Mr. Trump accuses Democratic activists in Wisconsin of mass ballot harvesting. Maybe a canvasser in Milwaukee finds a box of votes in his trunk that he—whoops—forgot to deliver.

The worst of this nightmare can be avoided. As states extend mail voting, they should tighten deadlines and ban ballot harvesting. The push for all-mail voting is relentlessly focused on ballot access, which is important. But ensuring ballot integrity is crucial for public confidence in election outcomes and, ultimately, for democratic legitimacy.

Democrats in Congress want to go the other direction.