Do you deny that Lincoln and the Union goverment thought it was illegal? Otherwise, why would they be fighting? Since the Confederates lost, their interpretation of the law is moot.
“Do you deny that Lincoln and the Union goverment thought it was illegal?”
You can’t apply the concept of “legal” or “illegal” to war, it simply makes no sense. Laws apply to individual men, while it is nations (or similar bodies of men) that go to war. That’s why there is no law on the books against war, because it wouldn’t make any sense, because you can’t prosecute a nation.
You could talk about whether a war is “just” or not, but not whether it is “legal” or not.
Now, there are certain modern treaties that define circumstances where its member states can go to war and penalties for going to war outside those circumstances. In those cases, you could talk about an “illegal war”, but those treaties aren’t applicable here, because this war predates them.