I think the SCOTUS could devise a legally sound reason for ruling against secession. After all, the Constitution reference a 'more perfect union,' and that would seem to imply such a union cannot be broken at will by the constituent states.
In the preamble, yes. Preambles are near-universally (if not entirely universally) regarded as having an exclusively introductionary purpose. Granted, this was not legally determined about the US Constitution in particular until later on (SCOTUS ruled on it in 1905, I think), but then it
was determined that the preamble cannot grant real powers or assign real tasks to the government. Another judgment would be... highly irregular. Needless to say, the preamble can be used (and
is used) to gain understanding of the intent behind the constitution and its articles, but to derive a power from such implied meaning, you must cite an actual article to which that meaning is then applied. Courts will not interpret the preamble to give the government powers that are not articulated elsewhere in the constitution.
Even supposing for a second that the Supreme Court does decide that a preamble grants concrete powers to government (which by itself would already make the whole ruling legally unsound)... what's "more perfect" anyway? Is a union that doesn't allow secession by definition more perfect than one which does? And would that not argue that the very origin of the USA (a secession, certainly, from the British crown) was something... less perfect? Thin ice, right there!
I brought up the Articles of Confederation because of that vagueness. Rather than an undefined "more perfect union", it literally called the union
perpetual. If you consider that as a characteristic "inherited" by the constitution, you can argue that "more perfect" = (among other things) "perpetual". But that would force you to claim that the constitution implicitly inherited characteristics of the legal doccument it replaced, which is.... not the norm, to say the least. And then you'd have to argue that a re-interpreted part of the preamble can be apllied to an actual article, which then grants a power to the federal government. Which article, then? Interstate commerce can't help here. The
other go-to article for "implied powers"-proponents is the "necessary and proper" clause, but that one only gives Congress the power to make all "necessary and proper" laws "for carrying into Execution
the foregoing Powers, and all other Powers vested by this Constitution in the Government of the United States". So you'd still have to point out the power itself. Even if you want an implied power, you'll have to bring up an actual
article that, well... implies it.
None of this is to say that there wouldn't be some clever way to rule against secession anyway. I'm confident such a way would be found, and in fact I think they'd go with something like the above and just brush over the gaping holes in the legal reasoning. But I wouldn't call that "legally sound".