> Either this is a lie, the USA and Spain have zero competing interests, Spain absolutely ignores it's own laws and regulations or Spain gave up on being an independent country.
Or the spy chiefs in the USA know exactly what they can ask from their Spanish counterparts and how so they avoid asking things the Spanish cannot legally fulfill.
For example the USA can ask for Spanish defense information, which the Spanish agencies share with them since they see themselves playing on the same team. The USA can ask for information on criminals and terrorist and non-affiliated spies operating in Spain, which Spain shares with them since they are playing in the same team. And presumably the USA is wise enough to not ask for compromat on Spanish leaders or things which undermine legitimate Spanish business interests.
> or Spain gave up on being an independent country
If you want to put it that bluntly. Have you heard the term Pax Americana? This is how it looks like from the ground up. Countries have the choice of being aligned with America (in which case they receive various boons) or not (in which case they receive pain and suffering in all kind of diffuse ways). Countries (and individuals in the countries) then make the rational choice. If you want to be crass about it you can describe it as giving up on being an independent country. In reality it is more like they accept to colour inside certain lines to achieve a greater prosperity for themselves.
Things like they can build regular weapons, but they can’t aim those weapons at the USA, or they can’t sell those weapons to unaligned countries.