The U.S. Constitution says nothing at all about the issue of secession, and the question was controversial in the years before the Civil War. In retrospect, it seems crazy that states should form a union without specifying whether they'll be allowed to secede from it, but this is what actually happened, with the worst imaginable consequences following eventually. (Though it should be noted that the main focal point of the antebellum constitutional controversies was the issue of nullification) rather than secession.)
Needless to say, the seceding Confederate states considered that the states' right to secession was implicit in the U.S. Constitution, which was according to them an arrangement between sovereign states from which they reserved the right to withdraw at will. It's notable that the Confederate Constitution was largely a literal copy of the U.S. one, and the Confederate secessionists made a point by refusing to add anything more about the issue of secession into it.
On the other hand, the ruling precedent in the U.S. constitutional law was set by the post-Civil War Supreme Court decision in Texas v. White. Unsurprisingly, the court ruled that the states have no right to secession, so that the Confederate States had legally remained part of the U.S. throughout the Civil War and Reconstruction, and all the acts of secession and the subsequent legal acts of the Confederacy were thus null and void.
In retrospect, it seems crazy that states should form a union without specifying whether they'll be allowed to secede from it, but this is what actually happened, with the worst imaginable consequences following eventually.
Note that the EU had the comparable problems recently with the PIGS countries: "hmm, they're on the Euro now and there's no way to get them off it." Much more amicable than the US's experience (and the situation was reversed: wanting to eject someone rather than wanting to secede), but still unpleasant.
I'm not sure if this is the right place to put this, but there's a problem I can tell I'm biased on so I'm requesting some advice from people unlikely to be biased on it.
Legally, circa the time of the actual secessions leading to the creation of the C.S.A, was secession legal? As far as I can tell it was (the Supreme Court may have practical control but they aren't infallible, and because of the Tenth Amendment), but I can tell I have biased emotions on the subject so I'm checking with people less likely to.