Sure they can, I can kick someone out of my house at a dinner party for holding certain political beliefs, same with religion. I probably shouldn't but it's my right as a private party.
Same with an employer firing people. If I work in Hollywood and we're about to release a movie, and the movie depends on how much the audience likes the actor, and suppose the audience is all Biden supporters, and my lead actor decides to start trashing Biden, it could cost me millions of dollars, and ruin the movie.
Also, if my lead actor starts saying it's his religious belief that gays can't get married on media outlets, outraging my paying customers, I should be able to fire him so I don't lose millions.