It is not unlawful to discriminate with respect to a matter that is otherwise prohibited under subdivision 1 if—
(a) the accommodation concerned is under the direction or control of a body established for religious purposes; and
(b) the discrimination—(i) is in accordance with the doctrine of the religion concerned; and(ii) is necessary to avoid offending the religious sensitivities of people of the religion.