This was not established law at the time of secession. Lincoln should have sued the seceding states to determine the legality of secession before beginning hostilities [0]. It was not established as law that leaving the union was illegal until 1869, when Texas argued in Texas V. White that secession was unconstitutional, and therefore the confederate legislature of Texas during the war was illegitimate. Therefore, the state still owned the bonds that it had (allegedly) sold to fund the war.
Further, Texas V. White was not a unamious decision. In the dissenting, Justice Grier wrote [1]:
>is Texas one of these United States? Or was she such at the time this bill was filed, or since?
>This is to be decided as a political fact, not as a legal fiction. This court is bound to know and notice the public history of the nation.
...
> I do not consider myself bound to express any opinion judicially as to the constitutional right of Texas to exercise the rights and privileges of a State of this Union
...
> I am not disposed to join in any essay to prove Texas to be a State of the Union when Congress have decided that she is not. It is a question of fact, I repeat, and of fact only. Politically, Texas is not a State in this Union. Whether rightfully out of it or not is a question not before the court.
This is reflective of a general political fact that sovereignty is not a legal question. Had the South won the war, we would not be having this arguement. It would be an undisputed fact that the Confederacy was a sovereign nation not subject to US law. It takes 2 sides to wage a war, and the North started the war because it found the South's political decision unacceptable [3]
Further, if we look at the post-war history, it was northern republicans who argued that secession was possible, as this is what allowed them to treat the former confederate states as conquered territory and therefore subject to direct congressional rule.
The southern Democrats (along with more moderate republicans) argued that secession was illegal, and therefore they were still full states in the Union, which would make laws such as the Reconstruction Acts [2] unconstitutional
[0] Not that it would have made any practical difference.
[1] https://www.law.cornell.edu/supremecourt/text/74/700#writing...
[2] As an unrelated matter, the North did repeal the Habeas Corpus Act 1867 in order to prevent the courts from ruling on the constitutionality of such reconstruction measures. Given the precedent set in Texas V. White, the southern states were likely correct that much of reconstruction was unconstitutional.
[3] That is not to say that the North was not justified in starting the war.