Remote work and tax residency
Working from a country usually strengthens your tax residency there. So if you're in Spain 6 months and working from there, Spain will likely want to tax your employment income. "My employer is in the UK" doesn't automatically mean you only pay UK tax. Residency rules apply.