'Akin to' is hardly a precise term; your use of 'analogy' is to be preferred.
This is not the place to settle the mattter on legal grounds. Ethically how does the analogy stand up? It is a requirement of justice not to discriminate against persons on the grounds of an irrelevant difference. The employer who discriminates against gays does so on the basis of such a difference, as does the academic to fails a student for the same reason. This puts the two cases on a level.
But are failing a student and assisting recruitment by the gay-discriminating employer also on a level ? I should say there is a difference. In failing the student, the academic is practicing discrimination. Assisting recruitment by a gay-discriminating employer is not itself practising discrimination; it is supporting the practice of someone else, the employer, who practices discrimination.
Suppose one were to recommend to the gay-discriminating employer only non-gay students. This would not necessarily harm gay students, who can get other jobs. By contrast, failing the gay student is necessarily harmful to the gay student. This is another difference.
A key point is whether engaging in a practice oneself (discriminating against, by failing, a gay student) is morally equivalent to acting as a means by which someone else (the gay-discriminating employer) can engage in a practice. By what moral principle could one adjudicate this ? A foreseeable consequences rule ? Suppose (a) I harm someone directly (assault her or him). Suppose (b) I do not harm someone directly but put them in a situation where foreseeably - foreseen by me - someone else will harm them. I think morally one situation is as bad as the other. Seen in these terms, assisting recruitment and failing the student are equivalent and an analogy holds.