The fact that California has no tax jurisdiction in Nevada, and that the US has no tax jurisdiction in Ireland, is an unassailable fact of life. Tax laws are subject to regulatory competition like many other things, and ignoring that -- insisting that this is an issue of morality or fairness -- is silly.
If the US had a globally competitive corporate tax rate (say 15%), it would make most of these tactics irrelevant. There's no need to shelter income in Ireland if they have the same tax rates. Because of the reduced sheltering, such a reform would probably raise revenue on net. But even if it didn't, it would have many ancillary benefits, such as repatriating many billions of dollars in corporate profits and increasing the degree to which they are deployed in the US, which would far exceed the costs.
Even better would be to reduce corporate income tax to 0% and increase dividend and capital gains rates to personal-income-tax levels to make up for it. The main reason dividend income is treated preferentially in the US is that corporate profits are already being taxed (in theory). Those multi-level nature of the US tax code creates unnecessary loopholes, as well as costs and confusion. Counter-intuitively, eliminating the corporate income tax would make it much easier to tax corporate income, because those profits necessarily flow back to investors either in the form of dividends or capital gains. If you are a resident of the US (and california) and you own 1 apple share, you pay taxes on your share of Apple's income. Even better, it would be progressive. Rich people pay more, poorer people pay less.
Simple, right?