States cannot leave the union because secession is illegal and has been so since the country's founding. The Constitution, in its aim to address the failings of the Articles of Confederation, got rid of words like "confederation" and "compact" and made clear that the states are an indissoluble union, not just a collection of loosely connected sovereign states. None of the states can unilaterally modify or override constitutional provisions.
The Supreme Court cleared up the lingering secession debate after the Civil War when it ruled against the State of Texas in Texas v. White. Chief Justice Salmon Chase argued that bond sale transactions that occurred between the Confederate government in Texas and private investors were invalid because the state government had no legal right to secede. When Texas and the other Confederate states joined the Union in the first place, they were joining an indivisible political union that they could not back out of. In other words, barring anything short of a civil war, states cannot leave the Union.