That may be the case, but the legal question remains. To what extent is your public job dependent on your private view. Should a catholic person be allowed to work at a family planning clinic if they hold privately catholic views. Can a phlebotomist be a Jehovah’s Witness. If I subscribe to some hardcore feminist ideology should I be allowed to work as a therapist with male clients? If I’m homophobic but in charge of town planning, what happens then?
As I said, this is likely misconduct in a public office, covered by the contract of employment, but it doesn’t answer the fundamental underlying question of whether that’s morally right or wrong. Can we separate the personal and public or is it a slippery slope where individual fitness to practice in any job is decided on a case by case basis based on what someone does in their private life?