Sounds like a good contract, congratulations!
You have an EU passport, so you can base yourself anywhere in the EU very easily. Officially, if you spend more than 90 days in another EU country, you should go through the EU citizen registration process (proof of funds, proof of address, proof of health insurance). In addition, you have 90 days visa-free in most non-EU countries, if you fancy a change of scene, and want to be more of a "digital nomad". (However, the 2 days every 2 week does put a limit on your travels. Later, when it's going very well, you might ask them to change to a week a month, or fully-remote, instead.)
To simplify, tax residence happens at 183 days (in a year). So I would suggest you keep your total stay in Spain (or other country) below this, until you have a better feel for how long term your contract is, and how long term your commitment to Spain (or elsewhere) is.
I think the most likely options are:
1. You can keep your base in the Netherlands, and pay tax on your Belgium earnings as self-employed. Then, as long as you keep your stays below the limit above, nobody should be upset about you not paying tax elsewhere.
2. You can go through the EU registration process in Spain (as mentioned above), get yourself a NIE (fiscal number), and become an "autonomo" (self-employed). Then you can declare your Belgium contract earnings and pay tax in Spain. If you want to live in Spain indefinitely this could be a good option.
3. If you earn good money, and you expect freelancing/contracting to be a long-term thing, then you could also consider incorporating your own company. Then your business costs (including, potentially, your salary, computers and travel) can be expensed. You can incorporate anywhere in the EU, so it could be Netherlands, or Spain, or elsewhere. Usually it would be where you plan to live going foward.
However, I know a couple of IT guys who got Bulgarian residence, and incorporated their product/consulting companies in Bulgaria because it has a flat 10% tax (personal and corporate). They still spend substantial time elsewhere in the EU. But... obviously... you can't (you can, but it's naughty and you might get into trouble) do a low-tax registration and then spend all your time in a high-tax country, so you have to be careful to stay below the appropriate day limits (easy if you split your year between Belgium, Netherlands, Spain, Bulgaria).