By the 10th amendment secession should be legal. The stupid Confederate attack on Fort Sumter and the resulting civil war of 1861-65 has caused the subject of secession to become legally unclear.
I agree the attack on Fort Sumter was stupid. I think they were simply chest puffing and saying they were great. Stupid move.
Most people are unaware that Lincoln struck at them first, and that's because they don't teach that in history, because it makes Lincoln look like the aggressor, which he was.