The KKK was formed by members of the US democrat
party who were bitter about losing the civil war. They didn't like it that the republican
party advocated that slavery was evil. Slavery
should be legal according to the democrats before the civil war.
One of it's most prominent early leaders was Nathan Bedford Forrest.
The local KKK organization called on it's members to vote for the democrat candidate because the democrat supported segregation. They don't like it that the republicans supported freeing the slaves.
(this is actually seriously true, and not a fabrication)