Laws are never are clear enough, there is always room for interpretation. Laws are not some piece of software that give predctable answers, hence courts and the whole legal system. And it is the latter one atvwork here, as intended.
This is a rationalization for convoluted legislation. The impossibility of perfection is a poor excuse for mediocrity.
Notice that we almost never hear about corporations avoiding payroll taxes or VAT. They avoid this kind of tax in particular because the rules are unusually squishy and incoherent, and every time they find another way to do it, governments respond by making it more complicated or even less coherent instead of addressing the root cause and replacing it with something clearer and simpler.
To be fair, the EU responded to this case by enacting a new directive that says "the minimum corporate tax shall be 15%".
OK, it's unfortunately 175 pages long [0] instead of seven words, but that really is the gist of it. The current legislation is a more "squishy and incoherent" set of rules [1] that say you cannot give "state aid" preferentially to any company, the technicalities of which are being litigated in the ongoing Apple case.
But this is the problem, right? You can't really do that because governments are supposed to spend tax revenue on things that benefit those in their jurisdiction. The extent of tax dollars not used for this is a measure of government inefficiency and in a perfectly efficient government it would be zero, i.e. the average taxpayer would receive benefits equal to what they pay in taxes.
What they're kind of implying is that they want multinational corporations to pay more than they receive so some other people can receive more than they pay, but they haven't actually specified who or by how much. It would be pretty silly and inefficient to deny large companies the use of government-operated transit systems or police protection, but to make it at all practical you end up creating enough exceptions that anyone can find a loophole.
I feel like the elephant in the room is this. A lot of these huge companies are monopolies or nearly so, and a large proportion of their profit is a monopoly rent. But a monopoly rent isn't attributable to a particular factory or the location of your software developers. It can't be attributed to something happening in any particular jurisdiction because it's actually attributable to something that shouldn't be happening at all, and which doesn't have any corporeal existence or physical location. So those profits naturally get declared in whichever jurisdiction has the lowest taxes.
But the problem is not that the monopoly rent is being taxed in the wrong jurisdiction or at the wrong tax rate, the problem is that the monopoly rent exists. Stop trying to pin it to a particular place and find a way to eliminate it.
Countries in Europe have been gradually tightening up on corporations avoiding payroll taxes by declaring employees as contractors. In the UK it's known as IR35 working. The EU have recently proposed the platform working directive, aimed straight at this problem.
This is not a means to avoid payroll taxes. They're still being paid by the contractor. And in a way that costs the corporation money, if contractors have to pay the tax out of after-tax income, because then they'll demand higher compensation to account for it, by the amount of the tax plus the amount of the tax due on the increase in compensation.
There are other reasons corporations prefer workers to be contractors, but that isn't it.
In the UK both employer and employee pay payroll taxes (national insurance) at about 13% of salary, additionally employers must pay a minimum of 3% of salary to a pension.
Contractors paid themselves a minimum salary to avoid the payroll taxes. They then took the rest of their earnings as dividends from their personal services company instead, the combination of payroll taxes + income taxes being higher than taxes on dividends.
Since that ruse has been heavily restricted, employers have had to increase contractor pay to make-up for contractors having to pay more income tax + national insurance.