The North was in a bit of a quandary after capturing Confederate President Jefferson Davis. They kept him locked up, sometimes in chains, for months after the war ended. If they tried him for treason, they might lose in court, because secession wasn't treason.
Trying Davis might result in a court decision that secession was constitutional, and the North would lose in court the principle they had illicitly won on the battlefield.
Chief Justice of the Supreme Court, Salmon P. Chase advised against any trial for this reason. Jeff Davis was released without trial because of it.
Secession was, and is, Constitutional. If the United States continues its headlong plunge into a statist, socialist tyranny, states may again secede from the Union.