Loophole free tax law is like bug free code: much harder than it sounds. Especially since the EU countries are actually independent and can have their own tax law.
Actually, it's not that hard. It only becomes hard when you try to use taxes to induce the set of behaviours you want. And then, completely suddenly Goodhart's law kicks in.