Answered on Quora.
It is absolutely not illegal in most states of the United States, although a few states do have laws protecting political beliefs. But in general, political beliefs are not a protected class. In some countries in Europe, you cannot fire people for their politics, but in most of the world, of course you can be fired for your political beliefs. Especially in an at-will state like California, which is hire at will, fire at will, you can fire anyone for any legal reason or for no reason at all.
And they do just that. It’s happened to me a number of times. I’ve been fired more than once for what I could only conclude was the fact that the boss simply didn’t like me. And there didn’t seem to be much I could do about that fact, that is, there didn’t seem to be any way to change my behavior so this person would like me. They just hated me at my core essence self, and when someone hates you at that base level, they’re gone forever and there’s no retrieving them.
I have even been fired for refusing to go along with Labor Code violations. My time was increased from 8 to 16 hours a day. Actually one shift was fired, and two shifts’ work were piled on me. I was forced to work 8 hours a day overtime. Forced overtime is illegal in California. I would put in maybe 9–10 hours of the 16 hour shift and go home, as was my legal right since they were breaking the law. Didn’t take them long to fire me.
I have been studying people who get fired from jobs I worked at and my friends who got fired from jobs. In ~90% of cases, I concluded that the person was not being fired for just cause but they were only being fired because the boss or co-workers or often both simply did not like the person. I think maybe only 10% of firings are due to true egregious and inexcusable work performance.
They never say they are firing you because they don’t like you. Instead they just make up a bunch of lies about “poor performance.” It doesn’t matter how good your performance is, if they want to get rid of you, you always have “poor performance” no matter how well you do your job.