The point is that the choice of how to define mental health is philosophical. You can focus on happiness and the quality of relationships or you can focus on our duties as critical thinkers. Psychiatrists focus on the former not based on any science, but on a productive culture that needs workers to be happy and content. In so far as religion doesn't interfere with capitalism, it's conducive to mental health. When it interferes with that "social functioning," as it does in the case of militant religiosity (the 9/11 attacks or the bombing of abortion clinics), psychiatrists may be inclined to posit a mental illness.
My goal here is to try to understand what's at the root of our talk of mental health and disorder.