Generally, the anti-discrimination laws – such as Title VII of the Civil Rights Act of 1964 – prohibit discrimination against employees and applicants based on certain protected characteristics (as in the case of Title VII, race, color, religion, sex, and national origin).
That said, there exists a (limited) exception, where such a characteristic is a “bona fide occupational qualification”. Here is the relevant provision of Title VII:
Notwithstanding any other provision of this subchapter, (1) it shall not be an unlawful employment practice for an employer to hire and employ employees, for an employment agency to classify, or refer for employment any individual, for a labor organization to classify its membership or to classify or refer for employment any individual, or for an employer, labor organization, or joint labor-management committee controlling apprenticeship or other training or retraining programs to admit or employ any individual in any such program, on the basis of his religion, sex, or national origin in those certain instances where religion, sex, or national origin is a bona fide occupational qualification reasonably necessary to the normal operation of that particular business or enterprise, and (2) it shall not be an unlawful employment practice for a school, college, university, or other educational institution or institution of learning to hire and employ employees of a particular religion if such school, college, university, or other educational institution or institution of learning is, in whole or in substantial part, owned, supported, controlled, or managed by a particular religion or by a particular religious corporation, association, or society, or if the curriculum of such school, college, university, or other educational institution or institution of learning is directed toward the propagation of a particular religion.
42 U.S.C. § 2000e-2(e).
As explained by one court,
Defendants bear the burden of establishing the affirmative defense that a particular qualification is a BFOQ. … Such an inquiry is not a simple matter of law— [t]o justify a BFOQ defense, an employer must show a high correlation between sex and ability to perform job functions. … Further, the defendant must be able to show that no reasonable alternatives to the discriminatory policy existed. … This requires that the defendants establish that the discriminatory policy is a legitimate need—a fact intensive inquiry that involves the defendants establishing that there are no non-discriminatory or less discriminatory alternatives or that Defendants made a good faith attempt to find such an alternative.
Crews v. City of Ithaca, 2018 WL 1441282 , at *7 (N.D.N.Y., 2018).
Clearly, this defense is not intended to give a defendant a “license to discriminate.”