Maybe taxes on profits were created so that companies invest their profit instead of hoarding it or giving it to shareholders, creating jobs and infrastructure in the process. As far as I'm concerned, Amazon is using its profits (or lack thereof) exactly as intended.
I don't think someone has designed taxes around incentives. In most countries wages are more heavily taxed than products, which balances the spending towards buying more things rather than employing more people. It seems very stretched, but some ecologists suggest to tax petrol more heavily and tax wages less, so it would be easier to employ more people for a task than throw more petrol at it (I use petrol in terms of fast tranports).
What about tariffs? They're designed to incentivize buying products made at home. What about "sin" taxes? They're designed to incentivize good behavior?
(Some) taxes are definitely designed around incentives.
If you returned it to shareholders they would be reinvesting it too (just somewhere else). You can return capital to investors tax efficiently using share buybacks. Haven't looked at Amazon's annual report in detail so can't tell if they are reinvesting profit in areas that will have high return or not.