It is not a law of the universe, but it is somewhat more than fashion. In California, it is the law.
Quoting from http://volokh.com/2013/08/06/lawsuit-over-firing-based-on-em...
In 1937, “the California Legislature, recognizing that employers could misuse their economic power to interfere with the political activities of their employees, enacted Labor Code sections 1101 and 1102 to protect the employees’ rights.” Labor Code section 1101 provides: “No employer shall make, adopt, or enforce any rule, regulation, or policy: [¶] (a) Forbidding or preventing employees from engaging or participating in politics …. [or] (b) Controlling or directing, or tending to control or direct the political activities or affiliations of employees.” Labor Code section 1102 provides: “No employer shall coerce or influence or attempt to coerce or influence his employees through or by means of threat of discharge or loss of employment to adopt or follow or refrain from adopting or following any particular course or line of political action or political activity.” These sections are designed to protect “ ‘the fundamental right of employees in general to engage in political activity without interference by employers.’ ”