The 1858 election, which was the most famous Senate race in American history and propelled Abraham Lincoln to the presidency, featured both candidates competing over who would do the best job of keeping blacks out of Illinois, and preventing intermarriage between the races.I suggest you read the whole thing. It seems history is a lot more complicated than the legend. Lincoln may have arrived at the beliefs of freeing the slaves later than he did in 1858. That is assuming you believe that and still he was part of a racially charged campaign.
The incumbent, Democrat Stephen A. Douglas of Chicago, was in a bind over the issue of slavery. Douglas was running for re-election in a free state, but he also was seeking the goodwill of Southern Democrats who could deliver him the party’s presidential nomination in 1860. He had authored the Kansas-Nebraska Act, which allowed residents of a territory to vote on whether to allow slavery, insisting the issue should be determined by popular sovereignty.
The challenger, Republican Abraham Lincoln of Springfield, believed that the Kansas-Nebraska Act and the Supreme Court’s Dred Scott decision, which prohibited territories from banning slavery, would inevitably allow slave owners to bring their property into free states, including Illinois. He had sewn up the votes of abolitionists in northern Illinois. Douglas had the votes of slavery proponents in southern Illinois. The election would be decided by moderate ex-Whigs in the middle of the state. They hated slavery, but they hated blacks, too, and for the same reason: because both plantation owners and free blacks would undercut the prices for white labor. Just five years before, Illinois had passed a set of Black Laws forbidding African-Americans from settling in the state.
So Douglas ran an all-out racist campaign. He accused Lincoln of plotting to free slaves all over the United States, and allowing them to settle in Illinois.
He said a lot of things wanting votes. Also let's not forget up until at least 1912 US Senators were still elected by state legislatures. Lincoln and Douglas may have held debates for the citizens of Illinois, but they needed the legislatures to appoint them to the US Senate.