My answer is that No it is not allowed because there is only one valid punishment for rape, and it is death-
Mainly because rape is nothing but spreading mischief and corruption in the land and stealing the honour of a woman, and leading it to become a problem if she intends to get married in the future, because:
1. The word that she got raped by a man may spread among the people, and that may affect her future marital life in the sense that it may become difficult for her or her family to find a spouse for her who is willing to marry her after he has heard of what has happened.
2. she may get pregnant and face difficulties and problems in the future of taking care of her child, and as far as i am concerned, society won't react positively towards this and may even isolate that family from themselves, or mke her an outcast, or to even maybe get her killed ( in some countries ) to keep their status and name and etc.
And many many other problems. End quote.
Nextly: Allaah made a clear punishment for the one who spreads mischief and corruption in the land:
“The recompense of those who wage war against Allaah and His Messenger and do mischief in the land is only that they shall be killed or crucified or their hands and their feet be cut off from opposite sides, or be exiled from the land. That is their disgrace in this world, and a great torment is theirs in the Hereafter”
[al-Maaidah 5:33] Quran source - https://islamqa.info/en/72338
Also see this:
The crimes of kidnapping, robbery and transgression of the Muslims’ sanctity by way of open and audacious hostility is a type of muhaarabah (waging war against Allaah and His Messenger) and doing mischief in the land, which deserves the punishment mentioned by Allaah in the verse in al-Maa’idah, whether that aggression is against people’s lives, wealth or honour, or it is scaring wayfarers and cutting off routes (banditry). It makes no difference whether that happens in cities, villages, the desert or the wilderness, as is the correct view of the scholars (may Allaah have mercy on them). Source - https://islamqa.info/en/41682
Firt Conclusion: the only valid punishment for rape is death, so to say castration is a permanent punishment and is equal to the crime of rape is wrong, firstly:
- No major sin can be truly expiated or completely compensated in this world, such as a person who burned 6 million jews, that person's crime can never be expiated or compensated in this world. And rape is one of the major sins in this world, and it is on the same list as shirk. so as to say: castration is enough because it is permanent for his lifetime is completely wrong. The most enough punishment is death. And even more in the hereafter on Allaah almighty's part.
And also: trying to change Allaah's laws is kufr.