As Basileus says, nothing is fated.
The Mexican war of Independence devastated the colony. If you hand waveum remove the war, or snuff it in infancy, this devastation doesn't happen. Spain now has a lot more revenue to stabilize, and Mexico has more time to develop. Ferdinand is a major problem as his actions are a big part of bringing on the Liberal rebellion. The easy way is to send him to an untimely death, but we could also posit that a better showing in the colonial theater might moderate things just enough to allow for a better (not necessarily miraculous) situation. Add in a son, or alternately, no children at all, and the Carlist Wars are averted. Or, with a different couple of decades prior, the CW may be averted. Or, with Mexico still in the fold, any US conflict may divert attention and the CW may be averted. So many things can change with something as massive as keeping New Spain, especially if it is done with minimal bloodshed. Nothing is fated.
With a stronger Mexico/New Spain, getting stronger, USA is not going to be so belligerent. USA could afford to be so aggressive because they correctly saw they were stronger. In TTL, this is not the case. Mexico has not been destabilized. Spain is more stable. This is a war Spain can win.
Spain was not averse to allowing US migration. They had been allowing it in the Louisiana Territory prior to the debacle with France/Sale. However, they did so while maintaining control, rather than the Mexican model of allowing the USAmericans in unfettered and with minimal oversight. The Texas/California situation is going to be vastly different TTL.
With any Spanish fortune, US boundaries may stop expanding with the Louisiana Purchase. Florida may be lost to US, though, although with Spain/New Spain in better condition, Spain may be more willing/able to push keeping it.
One thing that I think is ultimately fated is that large colonies grow to the point of independence being inevitable. Violent independence is not inevitable. Mexico will eventually reach the point of desiring, and being able to force, autonomy/independence. Whether this comes peacefully, or violently, is not written as of 1815.
This also impacts the Oregon Territory. Spain historically claimed it. Britain wanted it, although diminishingly so as time went on. US wanted it, and ultimately got it based on a combination of Britain's waning interest coupled with an inheritance of Spanish/Mexican legal claims post Mexican-American war. TTL, there are three players in the game. How things go depend a lot on how California develops. If New Spain can manage control of the settlements and inevitable mineral discovery, it may be able to force a favorable outcome. Things have gone too rosy for Spain so far, though, so I predict that Britain and USA compromise with the OTL British Columbia going British and Oregon/Washington going to USA, and Spain out in the cold.
With a minimal West Coast, USA may have much less presence in the Pacific, leading to Hawaii remaining British.
This also may change the US civil war situation. If the Mexican American war is averted, the political (and military leadership/lessons) winds may swirl differently. Or, a potential Spanish-USAmerican conflict in the 1850's, whether it breaks into war, or remains as a crisis, could change the political landscape. The civil war, in its OTL form, need not be fated. How the slavery issue is resolved, and/or when open conflict/secession breaks out will be affected by such massive changes of North American TL.