The US is one of the few countries that taxes their citizens no matter where they live. The good news is that the first $107,000 you earn from working overseas is covered by the Foreign Earned Income Exclusion (FEIE, using IRS Form 2555) which means you will not have to pay any tax on that income.
The Spanish tax system uses the Permanent Establishment clause so that if all your business is actually conducted in Spain it will view it as subject to Spanish taxes not matter where it is incorporated. https://taxsummaries.pwc.com/spain/corporate/corporate-residence
If you are set on staying in Spain I would look at trying to structure your company in Spain in a way that is efficient for Spanish Corporate taxes and so that your income is excluded from US tax by the Foreign Earned Income Exclusion. If you are flexible on where you live you might want to consider a move to Portugal to take advantage of their Non Habitual Resident tax rate of only 20%.