All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu 'alayhi wa sallam, is His slave and Messenger.
We mentioned in a previous fatwa that it is not permissible for a male teacher to work in a mixed school except in case of necessity and provided that one abides by Islamic conditions such as lowering the gaze, and so on.
When there is no necessity, though, like when boys’ only schools are available, then it is not permissible for him to work in a mixed school.
Now, it should be clarified that if there is a preponderant interest in his work in this mixed school, such as doing Da‘wah (calling to Allah), enjoining what is good, and forbidding what is evil, or minimizing it (evil), then there is no harm – Allah willing – in his work in this mixed school, even if other schools are available, while fulfilling the conditions that we mentioned, such as lowering the gaze, and so forth, as much as possible.
Allah knows best.