The argument isn't that it isn't "technically legal", but that it's expressly legal. I fill out a government provided form using government provided instructions, and answer them with complete and total honesty.
The result of that is that I pay less in taxes than if I had lied.
Are you honestly suggesting that lying is morally superior?
You do realize that setting up entities expressly for the purpose of avoiding tax is illegal in most jurisdictions right?[1-3] The absence of aggressive enforcement doesn't obviate the illegality of the actions.
In your scenario, those humble multinational corporations who are so beholden to the truth have to tell the tax authorities that the dozens of subsidiaries all have actual and legitimate business purposes and that they weren't set up merely to avoid taxes. I mean, it really is obvious why Apple transferred most of their IP to an Irish subsidiary for non-tax reasons, isn't it?
"You do realize that setting up entities expressly for the purpose of avoiding tax is illegal in most jurisdictions right?[1-3]"
I don't believe that is true. There are ~200 countries in the world. The UK, a pretty advanced nation when it comes to tax, did not implement general anti-avoidance legislation until last year. (See your footnote [1] for the exact date.)
Moreover, this anti-avoidance legislation is specifically targeted at what HMRC calls 'abusive avoidance'. It is not targeted at all avoidance.
The result of that is that I pay less in taxes than if I had lied.
Are you honestly suggesting that lying is morally superior?