the Civil War was definitely over slavery.
Lincoln wanted to end slavery, but as I understand it this was also a sort of power grab for the federal government.
Dr. Paul had a good answer for how he would have handled it when interviewed on Meet the Press in his '07/08 run. He said the way to do it, if I remember correctly, was to buy the slaves from the owners then set them free. Please someone correct me if I'm misremembering.
Anyway, my understanding is the federal government has a duty to uphold the U.S. Constitution, which does trump state law. That's why the 13th Amendment, making slavery illegal, was adopted.
Edit: I think this is the Meet the Press video: