This is disturbing, and the only solution is for the government to step in and make it illegal to fire someone without just cause.
I believe in many European countries employers aren't allowed to fire their employees unless there is proof of underperformance. It seems that we need to adopt something similar. It's already illegal to discriminate against someone based on their race, I don't see the problem with making it illegal to fire someone over their opinions on working conditions and politics. Corporations should not be running the country.
It's however true that you can't fire without cause and that courts usually demand strong evidence for such cause. So people would be more likely to sue.
That said, I still find Amazon's behaviour totally shameful, legal or not.