All perfect praise be to Allah, The Lord of The Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
Castration is prohibited according to the teachings of Islam and as was confirmed by jurists, since Allah, The Exalted said (What means):" And surely I will command them and they will change Allah’s creation." [An-Nisa'/119]. In addition, it is stated:" There are two interpretations as regards castration, the first one: The castration of men is prohibited since it is one of the Satan commandments, for Allah, The Exalted said (What means):" And surely I will command them and they will change Allah’s creation." The second one: Abstaining from marriage for the purpose of being totally free for the act of worship." [Al-Mabsoot vol. 15 pp.134] for Asarkasy.
Besides, scholars of Islamic jurisprudence are of the view that insanity and mental illness don't make castration permissible, since Al-Imam Al-Imrani stated as regards marrying the insane:" If he had the desire for marriage, then his father and grandfather are permitted to marry him for his own good as marriage achieve his chastity." [Al-Bayan Fi Madhab Al-Imam Ash-Shafie vol. 9 pp.212]. This indicates that being insane won't be a reason under any case for castration; rather being insane is a good reason for concluding marriage.
Yet, the excision of human organ created by Allah is impermissible save for cureless cases in which recovery won't be achieved except with this procedure in addition, mental illness and one's conduct might be treated with tranquilizers recommended by doctors to reduce the intensity of the case in order to prevent the patient from hurting himself or others.
Therefore, we are of the view that the aforementioned mental illness won't render castration permissible, since this is considered a violation over Allah's creation in addition to the medical risk resulted from this surgery. Thus we recommend his parents to be patient as much as possible and seek the reward from Allah as this affliction might be a reason of entering paradise.
Finally, we recommend his family to inquire from doctors as regards the proper medication and to ask for charitable and social organizations who are specialized in similar cases for help. And Allah knows best.