Dont forget that in OTL the destroyed Spanish mainland by 1816 had already reconquered almost all the colonies with the exception of the United Provinces of Rio de La Plata
But there was still unrest and these regions needed regular patrols and garrisons for order to be maintained.
How did spain build such a large army and navy since from what I understand the American colonies did not have the facilities or money to build and supply such a large force
Spain’s navy took a huge hit at Trafalgar. And Napoleon ravaged Spain’s mainland.
16 January. 1813 the spanish troops strikes the french troops at the north of the Ebro and force a french evacuation into France himself.
Godoy meets with representatives of Cádiz and declares that the King will only accept a Constitution that provides for independence of the American territories in the form of independent kingdoms and the formation of a Commonwealth among all this new countries and Spain, these accept the new conditions, the part where the old Constitution clarified that Spaniards are citizens from both continents will be used for the Constitution of the Hispanic Commonwealth, later, Godoy pressures Charles IV to accept the Constitution of Cadíz.
On 13 Juny the spanish wins the Battle of Toulouse and starts they march to Paris, Godoy autorizes the looting and burning of cities.
In August the spanish troops takes Valencay and send the prisoner Prince Ferdinand to meet his father in Madrid, for these dates, the Royal Family (with the notable exception of the Infant Francisco de Paula who decided to remain in Peru) is already reestablished in Madrid. Due to his attemped coup, Charles IV denies Fernando the succession to the throne, leaving the succession to his younger brother Carlos.
In October the spanish arrive in Paris after the rest of the coalition and begins to loot and burn the houses of the city, the Coalition troops are surprised by this but commanders like Blucher allow it, knowing what it happened in Spain.
Woah I’m noticing some issues with the timeline here. How does Spain magically defeat France and force them all the way back into France? Spain’s best troops were taken out by Napoleon and the Grand Armee was the finest army in Europe with many of its officers being the cream of the crop of its era. Its an inverse with Britain with many of Britain's naval officer corps being among the best and brightest during this era. The Grand Armee was also battle-hardened with many veteran officers. Even after the disastrous invasion in Russia, Napoleon came within a hair's breadth of seizing ultimate victory at Leipzig. Spain's army wouldn't be as well equipped or as well trained as the French army.
Why would Carlos IV accept this Constitution? He's a reactionary King, and passing this French inspired Constitution would be an anathema to everything he stood for. The King's sons Don Carlos and Ferdinand would both oppose this. Heck the Carlists would be more mainstream and stronger here with the traditionalists rising against this liberalism. Don Carlos was a legitmist and would likely rise up in support of his brother and traditionalism. Metternich would talk him out of this. The only reason France had a Constitution was because it was the center of the Revolution, and liberalism and Napoleon's legacy was so strong.
Carlos' Bourbon cousin Louis XVI was executed after the Constitution was passed by the National Assembly who asserted itself above the King. He and the other Royalists would never accept this. The Liberal "Francophiles" were widely seen as traitors to Spain for supporting Joseph Bonaparte, and them putting forth this Constitution upon the King would be a challenge to his authority. A more realistic pod is if this Constitutional movement a couple of decades later as liberal ideas rise up again in reaction to the new conservative counterrevolutionary order.
Godoy autorizes the looting and burning of cities.
Why would the Spanish Bourbons do this though? This is contrary to the Coalitions whole reason for fighting in the first place. Carlos was fighting to restore the French Bourbons to regain their throne. They also wanted to restore the balance of power and restore the traditional pre-Revolutionary monarchical order in Europe. This was why France was left intact after the Napoleonic Wars. This allowed for the Bourbons to be restored without much issue. The Bourbons were already unpopular in otl. Now with the Spanish burning their cities and their capital and then re-imposing the King, the French Bourbons will be more widely hated. The French public will likely be more emboldened to turn to Revolutionary ideas, and would likely rally around Napoleon who France would likely look to save them and drive out the foreign invaders.
Godoy meets with representatives of Cádiz and declares that the King will only accept a Constitution that provides for independence of the American territories in the form of independent kingdoms and the formation of a Commonwealth among all this new countries and Spain, these accept the new conditions, the part where the old Constitution clarified that Spaniards are citizens from both continents will be used for the Constitution of the Hispanic Commonwealth, later, Godoy pressures Charles IV to accept the Constitution of Cadíz.
So this is the Arranda Plan? Splitting the Empire into various independent Kingdoms wouldn't really solve very much. A lot of the issues in the Americas had to do with the racial caste system and the desire for social reform. Such radical liberal reform would likely see a revolt by the Absolutists/Conservatives in Spain and the colonies. Augustin d'Iturbide for example declared the First Mexican Empire in otl with the support of Mexican elites and Conservatives after the Liberal Trienium. None of them wanted to be ruled by a liberal system.