There's a big difference between the government asking you what deductions you qualify for - those are intended under the law - and a corporation making convoluted corporate structures to avoid paying the intended amount of tax. Generally, double irish sandwiches and the like don't pass the smell test.
If the convoluted corporate structures are legal then they are paying the intended amount of tax because they are following the law. It may not pass the smell test but they are legal. The complaint needs to be placed upon the laws and those write them, not the companies who abide by the law.
Just because a law exploit is possible doesn't mean it's acceptable to exploit it en masse. Yes, the law writers should fix their laws, as browser writers should fix holes in their browsers, but that in no way gives the exploiter a free pass.