I am not looking for why the wanted to secede but if it was legal because I have heard that Jefferson Davis stayed around in D.C a little longer after his state left the union in the hopes he would be arrested for treason hoping the case would go to the Supreme Court.
No. The U.S. Constitution codified the process in which a new territory is admitted as a new state in the United States, but it does not codify any process in which a state can leave it.
But the U.S. Constitution does codify the general, all-purpose way that the document itself can be changed, and that's through a Constitutional Amendment. So, the only way for a state to leave the United States legally is to pass a Constitutional Amendment. Through that process, a state must get the permission of 2/3 of both Houses of Congress, and 3/4 of the state legislatures in order to leave.
South Carolina and the other seceding states didn't do that. They believed that every state had the authority to leave the U.S. unilaterally, under the 10th Amendment (defers all powers not explicitly defined in the Constitution to the separate states), but there was no Supreme Court case until later.
In 1861, the United States had military installations in the South, so when South Carolina seceded, they demanded that the U.S. Army evacuate Fort Sumter, which they refused to do. After a months-long stand-off, South Carolina forces opened fire on Fort Sumter, prompting the Civil War.
Thus, despite the Confederate states each drawing up secession documents, and a new Confederate national constitution, after the war, in 1869, the Supreme Court ruled in Texas v. White that the secession of the Confederate states had been unconstitutional. That meant the secession was illegal, and so those states had never legally been separate from the rest of the United States. This made all the actions of the Confederate government illegal as well, so the U.S. government thereafter did not recognize the legality of any law passed or action taken by the Confederacy or any of its state governments.