

See my other response to peregrin5 but in addition you’re assuming rational actors all around. Actual reality is far more messy with many of those involved making decisions based more on feelings than any in depth reasoning. States stay together because there’s no obvious alternative. There’s no mechanism for a state to leave the union and doing so requires solving many problems that have no obvious answers.
Economics in general. California is responsible for a significant chunk of the entire US GDP as well as being one of the primary shipping hubs. My point was more along the lines that these other problems are tractable, you could for instance negotiate trade deals between the rest of the US and California. The military on the other hand is a much tougher problem akin to unscrambling an egg. There’s no obvious way to disentangle California from the greater US military.