Gender is something people cannot choose (albeit these days various medical treatments can make apparent gender appear different)
As for religion, although many people indoctrinated from an early age (with obvious implications e.g. classic Jesuits quote) it is an optional belief set, not something "forced on you" by genetics (though obviously family / community pressures can massively reinforce such beliefs - I speak as someone who was brought up with a particular religion heavily promoted by all family members).
If you are interviewing for a position where objective analysis of data is required then strong religious beliefs in a candidate would be a sign that candidate is happy to belive in something for which there is no evidence and thus may be seen as an indicator of unsuitability for the post.