The UAE has two different tax residency certificates, one for domestic use that only require a 90 day stay, and one "international" for double taxation purposes requiring "the individual to be physically present in the UAE for more than 183 days in a 12 month period". I guess it's the latter you need for Spain. Bit of paperwork to get it done, costs about 1,000 AED, and it's only valid for a year, but doable. Not sure if you need a tax residency certificate every year, or︀ just once.
See
https://kpmg.com/ae/en/home/insight...dent-and-tax-residency-certificate-guide.html
And the official UAE gov site
https://tax.gov.ae/en/services/issuance.of.tax.certificates.aspx
Staying over 183 days,︁ of course means you are in scope for effective management and control rules, but that︂ is as mentioned potentially avoided by having board meetings with minutes and executive decisions taken︃ outside the UAE. Or well, just accept that your foreign business is under UAE jurisdiction.︄
One thing to note is that many people use their UAE company to get︋ residency in the UAE. With a US LLC and no UAE company, you have to︌ find another route. An obvious one is as a remote "virtual" worker , you can︍ get residency if you are an employee anywhere in the world or have your own︎ non-UAE business as long as you can show you earn at least 3,500 USD (or️ equivalent) per month. It's very cheap but has to be renewed every year.
Otherwise you can get 2 year residency by purchasing a property in the UAE for at least 750,000 AED (or 2M AED for 10 year golden visa). It can be renewed every 2 year as long as you still have the property. Or getting 2 year residency by being a freelancer (but that s much more expensive than being a remote worker)