Title VII of the Civil Rights Act of 1964 prohibits discriminating based on sex except when it is a bona fide occupational qualification. Diversity is certainly not a bona fide occupational qualification, so they can't recruit based on it.
They may be justified in taking diversity into account in the hiring process, but they cannot exclude candidates based solely on sex. In Regents of the University of California v. Bakke, SCOTUS held that candidates can not be excluded exclusively because of race. In Grutter v. Bollinger, they decided that it was legal to take it into account, but only on an individual basis, not to exclude candidates altogether. These both deal with race, but I see no evidence that sex would be treated differently since the same law applies to both.