No, it's illegal in every state. It's also not remotely what happened here.
1. No one was fired. One guy resigned.
2. It had nothing to do with how he voted.
3. The backlash came from his donating financial support to a hate campaign
3. The backlash was in the form of people being pissed off about #3. Voting never entered into it, and not even SCOTUS bullshit redefinition of money as "speech" makes that much of a stretch legitimate.
Even if he was fired, which he was, again, not, it was because he pissed off a fuckton of people who: a) would be working for him, and/or b) need to use what they make in order for the company he would be running to stay in business (google's not going to give them 90% of their budget otherwise).
You wants to be a bigoted scumbag? Fine, that's your right. You want to *vote* like one? Absolutely, it's still how decisions get made in this country (hah).
You want to give public support to a hate group, and not have it held against you when it comes out in the open? Tough shit. Like the libertarians say, "the market has spoken."