Much depends on where you place your POD, but by definition it would have to be more stable and better organized than OTL Mexico by the 1840s to hold off the US. Presumably if a US similar to OTL exists in this TL, we can't have a POD much before the 1750s, or the butterflies will really flap. Does it include Louisiana? How about central America? If it is a kingdom/empire, is it's king the King of Spain in exile or a cadet branch like in Brazil? If it is a republic, when was the Revolution? There are too many bad legacies in place from the colonial era by the 1750s for Mexico to match the US in strength in the 19th century unless the US is somehow crippled or broken up before the 1830s, but in might catch up in the 20th. If the US manages to get Louisiana without too much bitterness, they might manage to get along: the US after all reaches the Pacific in Oregon fairly early on, and aside from the gold in California the southwestern deserts aren't that attractive. (If new Spain includes Louisiana and is unwilling to sell, I predict bitter conflict is inevitable, but the US might well sicken of war before it goes as far as taking Texas and California, and there's always the possibility the UK allies itself with a strong(er) Mexico against US expansionism).
I think if the US gets Louisiana and the Pacific Northwest, it will still grow into a superpower: the loss of Texas, California and the Southwest do deprive it of some valuable real estate, agriculture, and raw materials, but it remains the most desirable of settler colonies, and will almost certainly gain the population it needs: and California isn't that important to the US as a whole before the 20th century. And the US can always buy Mexican oil. Of course, the US will become less attractive if it is in a constant state of militarized cold war with Mexico, but, as I said, I doubt 19th century Mexico will be strong enough to force the US into a garrison state status, although it may maintain a standing army of semi-respectable size, rather than the near-joke it usually reverted to in peacetime before 1945.
Bruce