They took software that others gave away for free without restriction and did what they wanted with it. It took time but the community figured out this exploit path and patched it in subsequent license versions.
But you're right communities are now having to concoct a wild-growing collection of semi open-source licenses to protect themselves from abuse by a few big players.
From a moral/ethic one, its still shit.
You're legally allowed to do a whole lot of things. You can still be called an asshole for doing them.
The only people with any justification for hurt feelings are the community contributors.
Free Software was designed to avoid this, and has become stricter as the technology changed. Open Source was deliberately designed to thwart this. The entire intention of it was to allow businesses to resell work that was done for free. When you fork Free Software, your fork is also Free Software.
Also, Amazon were already contributing code back when these companies changed their licenses, the companies don't care about code contributions, just money.
I think the GPL has become somewhat obsolete because of this causing it create to completely nonsensical scenarios. For instance I can't comply with the GPL and add vanilla Stockfish (the currently strongest chess engine, licensed under GPL) to a chess app released on the Apple store, yet somebody can slightly modify the engine, keep all those modifications proprietary, and sell access to the engine on the same App store, without source access, so long as the computer is done through a middle-man server instead of being done locally.
The GPL no longer suffices to maintain the spirit of intent of the GPL. Like a peer comment mentioned it seems (??) that AGPL is their update to resolve this.