In the case of Amazon, and this applies to GM and IBM too, they are taking advantage of an aspect of US tax law (which also applies to individuals, incidentally) that allows business losses and investment losses to be deducted from profits, and worse IMO, to be carried forward for years. For example, let's say that I sell two blocks of stock this year. On one block I make a $50,000 long-term capital gain, on the other a $30,000 long-term capital loss. My net taxable income from the two transactions will be $20,000, which means that US taxpayers subsidize business and investment losses. IMO, losses should not be subsidized, and taxes should be owed on all gains. And I say that as someone who takes advantage of subsidized losses nearly every year. And if your gains in any given year are less than your losses, you can carry the losses forward for years and get future tax credits. And that's what Amazon did.
And before anyone should be complaining about Amazon, they are compelled as a public company to exercise their fiduciary responsibilities to the best of professional practices, which means taking advantage of lawful and obvious tax breaks which benefit their shareholders. If Amazon management were to get idealistic and say that these tax breaks are unethical and refuse to take advantage of them, Amazon could be the target of a shareholder class action suit, and they almost certainly would be and lose.
(The famous case of Apple funneling profits through Ireland to get a lower tax rate is a different scenario. That was a case of Apple just being innovative, with the cooperation of a friendly Irish government. But they didn't have to do it, and could have deemed such a proposal too risky.)
IMO, US tax law is a mess of special interest credits, exemptions, and loopholes that should just be simplified and fixed. Changing rates is a secondary consideration, and rates could probably be lowered overall if we just stopped the madness. This is what annoys me about the current crop of Democrats - they make dumb-ass proposals that are intended to appeal to ignorant voters rather than solve real problems and get achievable results.