Simpe, Spain retains hold of netherlands and is more tolerant of minorities. OTL the Netherlands and Low Countries produced the majority of Spains income it was 7 times more than that gotten by Spain from the new world treasure fleets. What I have noticed is that the Spanish economy was geared in such a way that Castille, Galicia, and Andalusia were geared towards agriculture while the Netherlands, low countries, Basque lands, and Catalonia were geared towards manufacturing. So when Spain lost the Netherlands this balance between the Manufacturing and agricultural sectors in Spain collapsed and that could explain the low literacy rates and lack of urbanization or agricultural productivity.
At the same time if Stain does not fight all over Europe in pointless wars than its finances would be more secure. From what I have gathered the Bankers who financed Habsurg Spain lost their assets multiple times due to Spain declaring multiple bankruptcies. Get rid of those bankruptcies and with retention of the entire Netherlands I can see Spain retaining it's status as a great power. Hell make the Iberian Union also last at the same time and what you get is one really overpowered Spanish empire that is in a good position to industrialize sort off.
The issue with just low countries is that the eighty years war destroyed Flanders and Brabant and once the Spanish took over refugees fled Antwerp for Amsterdam which in turn fueled the dutch golden age while the low countries which were previously the hub of dutch trade stagnated.