All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The Shaafi‘i scholars stated that a woman is required to wear the Hijab in front of an insane man. Shaykh Al-Islam Zakariyya Al-Ansari said: "They (women) are required to wear the Hijab in front of an adolescent just as they are required to wear it in front of an insane man."
The reason for this is that many insane persons are like the sane ones in terms of having sexual desire for women.
Allaah Knows best.