Are you implying a write-in candidate got more votes than Obama?
No, Obama got all his opponents thrown off the ballot by challenging signatures on nominating petitions.
Suppose you're registered to vote under the name of Johnathan Pawlak, of 123 Main St. Apt. 1. One day a man comes to your door asking you to sign nominating petitions for Joe Schmoe, who's running for office. You sign your name John Pawlak, of 123 Main St. Apt. 1.
Now Joe's opponent hires a lawyer to challenge your nominating petitions, pointing out that there is no John Pawlak registered to vote at 123 Main St. Apt. 1, just a Johnathan Pawlak. Oops! Sorry, that signature is invalid.
Wash, rinse, and repeat if he forgot to put "Apt. 1" on his petition signature.
Find enough innocent mistakes like that, and Joe Schmoe gets tossed off the ballot because he doesn't have enough valid signatures on his nominating petitions.
Which is exactly how Obama first got elected to the Illinois Senate - by challenging his opponents nominating petitions until they didn't have enough to remain on the ballot. Obama ran unopposed.
Even if your opponent has enough perfect signatures on his nominating petitions you can force him to burn through his entire campaign fund defending them.
That's democracy, Chicago style.