The friction comes in for Spain or France (whoever held the Louisiana territory) as American settlers move farther west. Once settlers start crossing the Mississippi in progressively larger numbers, then the struggle for control heats up. Think of the later situation in Texas; only farther removed from the coast and a much larger area to police.
depnding on the POD spain will lose Louisiana to america. If before the Independence movements then no Spain wont lose, it but after Independence of colonies probably.
But if Spain keeps Louisiana then that means Napoleon never invades Spain which would have even bigger consequences.
With a Spanish dynasty on the throne that is not plunged into upheaval which lead to the junta systems being established in Spanish colonies that in turn formed the locus around successful Independence movements, Spain will not see rebellions break out in its territories.
The reason is simple, every rebellion before the juntas was isolated and put down quickly. With no development of junta system, Spanish elites in the colonies dont feel their rights are threathened by the absolutist monarch as otl when the king after regaining the throne repudiated the Constitution he signed while in exile promoting the rights of autonomy for his colonies.
With no colonial Independence you have Spain retaining its navy which numbered even as late as 1815 around 145 warships with many ships of the line. The USA regardless of westward settlement would not attack Spain because if it does then the Spanish navy will blockade the American east coast not to mention Spain will have all the resources of latin America to draw upon. Also Spain was an American ally during the revolutionary war and had good relations even in the early 1800s. Also Spain was no Mexico, it was a european great power.
Hell even in 1815 before losing its colonies Spain was the number 3 or number 4 power in Europe behind UK, France, and Russia.
Not to mention with no loss of colonies you butterfly away the carlists thereby butterflieng away instability in Spain.
Mexico faced issues of instability, upheaval, low pay for soldiers, and numerous other issues which was why they lost to the United states. Not to mention by 1840 they were exhausts after many decades of internal unrest and civil wars and were lead by one of the worst heads of state, santa anna.
Spain for all its faults would not be in such a situation. USA and Spain go to war in 1830s, then initially US achieves success in Louisiana but fail to take New Orleans due to Spanish sea power. The US navy of
frigates is destroyed by Spanish
ships of the line and Spain blockades the east coast. New England gets pissed off and the war becomes unpopular. Spain draws upon the resources of its colonies and with no wars against France or Britain is able to send more troops to fight Americans from Mexico and south America. and the war ends in status quo. Thats how it would turn out. The only wildcard is Britain.
By the way a Spain which does not lose Louisiana means it was able to beat back France which in turn means it must have had skilled generals and/or monarchs and that in turn means no bottling up of the spanish fleet by the Brits and all that jazz... thats even more butterflies not to mention an even greater Spanish navy.