https://en.wikipedia.org/wiki/Double_Irish_arrangement
I agree with you in like an end-state kind of way, but this issue was super ridiculous & used by nearly every multinational company over the course of decades. I don't understand why the EU has targeted Apple specifically other than that they're a big fish, but this was a colossal screwup by government and it went on forever. If you want to tax corporations, tax corporations. There's a million tools at your disposal to get it done. The reason it doesn't happen is because people are ill-informed, elect charlatans, allow revolving doors between biz + government, etc. People need to stop pointing the finger outward, problem is 180 degrees away.