Yes, they should. At the same time, Congress did not knowingly create anything, nor did they overlook known loopholes.
On the contrary, Apple's accountants created a
brand new and elaborate method of avoiding taxes that no one had imagined before, and which was CLEARLY NOT INTENDED BY CONGRESS.
That's good, because...
Corporations HAVE NO LEGAL OBLIGATION TO AVOID TAXES. In fact, they have no legal duty to maximize profits, either. These are two common but bogus myths that get repeated all the time to excuse investor greed.
Yes, corporations are supposed to be run for the best interest their investors. But this can mean anything from concentrating on employee happiness, to being environmentally correct, to being good citizens, to yes, maximizing profits... but none of that is legally required. It's up to the corporate leadership to decide what is best.
As for the legality of what Apple does, this
NY Times article notes that:
'
NO taxpayer is obliged to pay the government a penny more than the law requires, the Supreme Court said in 1935. But the court also said no corporation was permitted to use “elaborate and devious” means — known nowadays as “gimmicks” — for the express purpose of evading taxes.'
You're intelligent, and I'm short on time, so I'm going to leave you some links to read:
Corporations Don’t Have to Maximize Profits -NY Times
The fig leaf of shareholder value covering corporate tax avoidance, removed
Delaware corporate law: directors have no obligation to minimise taxes