Yes, a private sector employer may do this; the First Amendment guaranty of free speech (which underpins the right to campaign contributions) applies against government action, not to private employers. Your employer may set terms and conditions for work, which terms and conditions infringe or limit your right to do non-work activities; the employer can say that if you want to work here and us to pay you, you have to abide by our rules.