MONTGOMERY, Ala. — What do Robert E. Lee, SpongeBob SquarePants, Nick Saban, Jesus Christ and George C. Wallace have in common?

With no campaigns and no war chests — but, in some cases, tombstones — they all came up short in the Dec. 12 special election for a United States Senate seat from Alabama, according to county-level tallies that the secretary of state’s office released on Thursday.

That Wallace and Elmer Fudd lost was not a surprise, even after the off-the-rails campaign that pitted Doug Jones, the Democratic nominee and ultimate victor, against Roy S. Moore, a Republican and a former chief justice of the Alabama Supreme Court.

But Mr. Jones won by fewer than 22,000 votes, and more than 22,800 residents, including Senator Richard C. Shelby, a Republican and the dean of Alabama’s congressional delegation, elected to write in the names of other figures whether they were dead, alive or fictional. Many voters who opted for write-in candidates said they found Mr. Jones too liberal, and Mr. Moore, who was accused of sexual misconduct or inappropriate advances involving teenage girls, too toxic or extreme.