I am not an American (I come from the Levant), but I am interested in American political history (and in the history of federated states more generally).
Was it (or is it) actually possible for a state in the American union to secede legally? Does the constitution allow for this?
[Obviously I’m assuming the confederate states’ secession was considered illegal by the rest of the union]
Are there any historical examples of states legally seceding from a federation? I know that Canada, Russia, Spain, and the UK (not strictly a federation) have all had various historical separatist movements, but could a state actually secede legally?
At the time of the Secession in 1860 and 1861, the issue was "not clear".
The view of a lot of people was that secession was legal under the 10th Amendment. The belief being that the states were sovereign and that the Constitution was something voluntarily entered into, so was also something that could be left voluntarily also. So, when they asserted States Rights in 1860, it was generally not in the context of what we think of now in terms of relative federal power to state power, but in the very specific narrow sense that States Rights as defined by the 10th Amendment was stated as: "The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people. " The view of the secessionists was that this specifically meant that the States had a right to secede as part of the overall 10th Amendment.
The Unionist view was that this was not correct and that the adoption of the Constitution was for all-time. There was no provision in the Constitution allowing for states to leave. I do not add as many words to this paragraph as it really was that simple as position.
This was never really taken to court prior to the Civil War. In all probability, the Supreme Court would have have ruled that the situation was not justiciable. The Supreme Court reserves the right to not hear cases that reflect a fundamental political position or on ones where there are no legislation or laws as guidance. This issue feel directly into both categories. The secessionists could have sued in any of the federal districts in the south and have received a favorable result, but that would likely not have survived an appeal to the Supreme Court.
President Buchanan's position reflected the strict legal argument above. He felt that it was not legal for states to leave, but was fundamentally an issue for Congress to provide guidance. President Lincoln's position was that he would not recognize a Supreme Court ruling on the issue, but that he was open to the idea of a Constitutional Amendment to clarify the matter.
The admission of US states is a legislative matter and it is not an action specifically within the Constitution either, so there is an argument that admission or secession is allowed, but no applicable laws were passed to cover the secession side.
There is a court case from 1869 called Texas vs White on this matter and it ruled secession was illegal, but I personally think that it does not present a strong case for the actual concept of secession as this followed immediately after the Civil War and there was a large sentiment at the time related to this topic. It is entirely possible that a later court would disallow that case as a legal precedent and rule differently.
Ultimately, it boiled down to the secessionists not attempting either the legislative or judicial paths that ultimately doomed their cause. There was a lot of support for the concept that secession was legal in the north. By moving this into an armed conflict and firing first, the secessionists invalidated the legal arguments and alienated their supporters in the north. The Confederates decided upon a position that their actions were legal and inarguable and that they constituted a new sovereign nation and they did not need the US permission to do so and the refusal to recognize that position constituted a causi belli for a war between sovereign nations. There have been better political calculations than that particular train of thought.