When the government tells an employer that they can’t fire a person for x reason, the first amendment gets involved. Because that’s the government limiting the speech of a private citizen (or in the case of a company/corporation, a group of private citizens that apparently gets all the rights of a person).
Which is when employment law does swerve into first amendment territory