I agree, but this is really not the right place to “make a stand.” A person employed by the government does the government’s bidding, or else. If a court allows anyone to make a religious exception for their job, then it’s only a matter of time before Muslims in public positions would be permitted to refuse any kind of accommodations for non-Muslims.
Morality is the only place to make a stand. And homosexuality is absolutely immoral.
So, by your logic, no matter how immoral the act is if its your changed job description to do it you have no choice. Jim Crow, Nazi Death camps, etc come to mind as real examples of of your position.