First of all, Lincoln was a Republican but he was also openly racist, so you can take that now or have it gift wrapped
Second, Northerners went to war with Southerners to keep them from breaking away and leaving the Union. The Civil War was not about the N-word, it was not about abolishing slavery, and it was not even about equality for black people. It was about keeping the Union from splitting up.
Third, I agree that Southern conservatives who supported slavery and racism were wrong. You won't get any objection from me on that. But you'll notice that after the Deep South went from Republican to Democrat, their racism didn't magically go away. That means that it wasn't about party name, but ideology.