reason.com/volokh/2018/08/15/muslim-male-inmate-objects-to-strip-sear
"According to the plaintiff, when it was his turn to be strip searched, defendant Buhle, a female correctional officer, approached him and ordered him to strip. The plaintiff states that he asked defendant Buhle how she was able to do that and she responded, "I'm a dude." The plaintiff says he looked at the other correctional officers, "to see if this was a prank," but that they avoided eye contact with him. He alleges that at this point, he "started to panic because he knew that Officer Buhle was a female based on her female features (breasts, face, voice and demeanor) and that exposing his nakedness to her would be in violation of his Islamic beliefs ….
The plaintiff indicates that "[i]t was later brought to [his] attention that Officer Buhle is a female claiming to be a male and therefore is afforded all of the duties that the male officers perform without discrimination.""
As I understand it this has been an issue in the UK, in that in the past this was deemed a barrier to employment of transgender police officers, as they would not be able to search people, but in the end it was decided that your opinion about your gender identity (as the searcher) is more important than mine (as the person being searched), essentially.
It's interesting in that it essentially comes down to competing fantasies (that you are actually a man versus my belief that god doesn't want me to be naked except in front of my wife).