Unilateral secession as practiced by the southern states was illegal before the rebellion and it is still illegal.
South Carolina was within it's right to secede. Just like America was within it's right to leave England.
Seems to me that the 'secession' from Great Britain was followed by an 8 year period known as the Revolutionary War.
What must be remembered is that South Carolina gave the union fair warning and asked like any other nation that the troops be removed.
And again, since Sumter was the property of the U.S. government what right did South Carolina have to demand it be turned over?
And for that matter, why did the north invade Virginia?
Becuase Virginia had joined the forces of the rebellion then waging war against the United States.