Earlier quoted context omitted.
Uhh, I don't want to be Amazon defender, but in US most of the employment is at will. In practical terms, they can fire you for any or no reason at all. There are practicalities that come into play that have to do with unemployment insurance and whatnot, but company policy violation is a defensible 'cause' for firing. I am not a lawyer nor am I condoning this, but them is the facts. edit: added play
I think people are outraged not because it's illegal, but because it's unconscionable. I think the general understanding is people shouldn't have outside-work activities be held against them, maybe it's time for the law to catch up. It's pretty easy to come up with a lot of absurd and "legal" at-will policies (e.g. we'll fire anybody who watches porn)
My favorite which would work in much of the US is "We'll fire anybody who registers with the Republican party." (Or Democratic, if you prefer.) Especially in a state where registration is required in order to participate in the primary. It is legal, but, I believe, completely unacceptable to just about everyone.