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 is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
First of all we ask Allaah to cure your husband and grant him good health. We advise you to supplicate Allaah much and seek Ruqyah for him with the legislated mention of Allaah and Prophetic supplications and seek a method of treatment as every disease has a cure. In principle it is not permitted to carry out a castration of a human being without a valid religious reason. Some scholars stated that there is a consensus amongst scholars about this prohibition. Ibn Mas'ood said: “We were fighting in battles with the Prophet and we had no women, so we asked him: ''O Prophet of Allaah, why don't we get castrated? He forbade us from doing so.” [Al-Bukhari] Besides, there are many disadvantages in having a castration, like stopping human reproduction, causing harm to the body and so forth. This applies to the person who does it willingly. But if it is confirmed by expert doctors that it is necessary to carry out this castration then there is no harm in doing so. Having a castration should not affect the continuity of marriage so do not pay attention to the statements of your friends who claim that marriage becomes void.
It should be noted that it is not permissible for a Muslim to say that such a matter is lawful or forbidden or discuss the rulings of religion without evidence from the Book of Allaah and the Sunnah of His Prophet and without an evidence from the scholars.
Allaah Knows best.