The 16th century was a golden age for the crowns of Aragon and Castille. Fueled by Aztec and Incan plunder, they entered an age of political and military pride. This resulted in a series of wars that brought the state multiple bankruptcies. Because of these bankrupticies, taxation and fiscal pressure was increased. Because of these taxes, many merchants and manufactorers bought titles of lower nobility, as the title of Hidalgo brought tax cuts with it. The problem is that these Hidalgos are not allowed to do physical work.
This brought the Spanish manufactoring and trade in a deep, structural crisis. In the beginning this was not so bad, as products could be imported, payed for by American silver. Food too was imported.
The 17th century brought the bill, as the American silver mines were exhausted. The Spanish economy sank into a deep stagnation, with an enormous bureaucracy, no internal production and no schooled workforce.
This was the end of Spain as an economic powerhouse. Without a strong economy, there is no possibility of fielding armies, navies, etc.