The answer is: profits from the Americans caused growing inflation in spain, the costs of many wars rapidly emptied the spanish treasury
The rise in America's economic power cause Spain to lose a lot of market that they previously dominated through trades.
As the profit obtained by the Americans got higher, GDP that Spanish producers able to create keep declining, which cause a growing inflation in Spain. This situation got worsened by the need of high government budget to be allocated to the military.