Sterilization is a medical procedure that makes a person infertile and unable to reproduce. There are various methods of performing sterilisation on either males or females. Many sterilisation methods are typically irreversible.
Castration and sterilization are forbidden in Judaism. 
"No one who has been emasculated by crushing or cutting may enter the assembly of the LORD. "
"For there are eunuchs who were born that way, and there are eunuchs who have been made eunuchs by others--and there are those who choose to live like eunuchs for the sake of the kingdom of heaven. The one who can accept this should accept it."
There are many accounts of self-castration in the early church. The theological arguments for self-castration, possibly based on Matthew 19:12 , seem to have been lost. The practice was general condemned by early prominent writers within the church.   Self-castration was reportedly carried out by the early Christian theologian Origen.
"The saint in whom God delights is the ideal eunuch. Life has come to an end where the 'kingdom of God' begins."
The Catholic church regards sterilization to be a form of contraception and is therefore generally disallowed.  The only exception is if the sterilization is a side effect of some other essential medical procedure, such as a hysterectomy to remove a cancer, under the theological principle of the double effect.  According to the church, avoiding medical risks associated with a future pregnancy is not an acceptable basis for sterilization.
- "Any sterilization [that] has the sole immediate effect of rendering the generative faculty incapable of procreation, [and], notwithstanding any subjectively right intention of those whose actions are prompted by the care or prevention of physical or mental illness which is foreseen or feared as a result of pregnancy, such sterilization remains absolutely forbidden by the doctrine of the church. "
In Ireland and other countries, aversion to sterilization by Catholic doctors may have encouraged the use of symphysiotomy as an alternative to Caesarian section births, despite the high medical risk and impact of the procedure.
Broadly speaking, sterilization is forbidden in Islam based on the reasoning that God's plan is for humans to reproduce.  It is also forbidden for Muslims to perform sterilization on another.
However, if further pregnancies would pose a significant health risk to the mother, sterilization may be allowed. 
Castration, being a form of sterilization, is also not permitted. Despite this, owning eunuchs was not forbidden and many eunuch slaves were imported into Arabia over the centuries.