I think you need to remember one thing, the victor rights the history books.
You can go on believing that is had all to do with freeing the black man by republicans but you would be gravely mistaken.
The ordinances of secession were written by the secessionists themselves at the time. No victor had anything to do with them.
If you don’t believe that the south rebelled because of slavery you are gravely mistaken. I would recommend educating yourself by reading the ordinances of secession and the written accounts made by the secessionists at the secession conventions.