Context
Moving to Spanish territory for a period of more than 183 days implies that you can be considered as a tax resident in Spain.
The consequence is to begin paying personal income tax in Spain based on the global income criterion at a progressive tax rate of up to 50% (that is, income is taxed not only from Spanish sources but also from the rest of the world).
Same happens in the Wealth Tax, by which tax residents are taxed in relation their net worth, counting all their assets (located in the country and abroad).
What is the Beckham Law?
This is an optional tax regime established in article 93 of the Personal Income Tax Law (and complementary regulations) applicable to all foreigners who come to live to Spain for work reasons and those who meet certain requirements.
Which are the tax benefits?
Be considered “non-tax resident” in Spain.
Income Tax: Worlwide source of income related to salaries are taxed at a fixed rate of 24% up to €600,000 per year (versus rates that can reach more than 50%), and from that amount onwards, at a rate of 47% .
In the case of capital gains and financial income (dividends, interests, etc.), exclusively those obtained in Spanish territory. Rates rise to 19% up to €6,000; at 21% up to €50,000; 23% up to €200,000; 27% up to €300,000 and 28% from that amount.
Wealth Tax: exclusively for assets located in Spanish territory, at a tax rate ranging from 0.2% to 2.5%.
Do not present Form 720 (applicable to all residents in Spain, with assets abroad for more than €50,000).
What requirements are needed to fit into the tax regime?

Not being tax resident in Spain for the last 5 years.

The motivation of the relocation needs to be directly related to:

Work contract as an employee (also applies to remote workers). Not available for professional athletes/sportsmen.

Administrator of a company.

Starting an entrepreneur business.

Highly qualified professionals, or carrying out training, research, development and innovation activities.

Not having economic activity with a permanent establishment.