A. The prohibition:
Male humans/animals: It is [Biblically] forbidden to destroy [i.e. castrate] the reproductive organs of any male creature, whether human, animal, bird [or even fish]. This prohibition applies whether the species is Kosher or impure. This prohibition applies whether in Israel or the Diaspora. One who transgresses this prohibition is liable for the penalty of lashes.
Female humans/animals: It is [Rabbinically] forbidden to destroy the reproductive organs of a female creature, whether human or other creature, although one who does so is exempt from lashes.
Castrating additional reproductive limbs: If one of the reproductive organs were already destroyed, it nevertheless remains [Biblically] forbidden to further destroy the organs. One who does so is liable for lashes. This applies to any [male] creature, whether human, animal, bird [or fish]. For example; If one person castrated the penis and a second person castrated the testis. Or, if one person detached the testis and another person cut the nerves of the testis. Or if one person crushed the penis, and a second person detached it and another person cut it off, each of these people receive lashes, even though the latter person castrated and already castrated person.
It is forbidden to castrate the reproductive organs of any creature, whether human, animal, bird or fish, whether male or female. One who castrates a male creature is Biblically liable for lashes. It is forbidden to further castrate even an already castrated creature.
B. Chemical sterilization:
Male: Chemical sterilization is forbidden to be done to any [male] human or animal although does not carry lashes.
Female human: A woman may drink sterilizing chemicals in order to prevent her from giving birth. [This applies even if there is no justifiable reason for her to do so, and she does not experience pain in childbirth. Other Poskim however rule this only applies if the woman has pain in child birth.]
May one have his pet sterilized?
 Michaber E.H. 5/11; Rambam Issurei Biyah 16/10; Shabbos 110b; Vayikra 22/24: “Ubeartzechem Lo Sasu.”
 Birkeiy Yosef 5; Sheilas Yaavetz 111, brought in Pischeiy Teshuvah 5/8
 The reason/source: The verse [Vayikra 22/24] states “Ubeartzechem Lo Sasu” and from here we learn of the prohibition against castration. [Shabbos ibid; Rambam Issurei Biyah 16/10] The reason behind this prohibition is because G-d created the world in perfection and desired the continuity of each of his creations and commanded them to procreate. One who castrates a creature reputes G-d’s creation and is doing an act of destruction to his beautiful world. [Sefer Hachinuch Emor 291
 Michaber ibid “One who castrates a female is exempt from lashes although it is forbidden to do so”; Rambam Issurei Biyah 16/11; Magid Mishneh on Rambam ibid; Shabbos 111a “Ela Beisha”; Toras Kohanim on Vayikra 22/24 in name of Rebbe Yehuda “There is no castration by females”
Other opinions: Some Poskim rule there is no “castrating” prohibition to castrate a female human/creature, although it is forbidden to cause her pain against her will, or for no need, due to a separate prohibition of Tzaar Baalei Chaim. [Taz 5/6 in interpretation of opinion of Rebbe Yehuda ibid]
 So is the general rule of “Patur Aval Assur” that it contains a Rabbinical prohibition. [See Rambam Shabbos]
Other opinions: Some Poskim rule that the Michaber and other Poskim rule like the first opinion in Toras Kohanim ibid that the prohibition is Biblical even by a female, although one is exempt because they are not included in the Lo Sasei of Lo Sasu. [Gr”a ibid]
 The reason: Castrating a female does not carry Biblical liability being they are not commanded in Peru Urevu. [See Rashi Shabbos ibid] Alternatively, the reason is because their reproductive organs are inside the body and hence cannot be destroyed with direct action. [Taz 5/6] Nevertheless, it is still forbidden to castrate them as even women are commanded to populate the world due to the verse “Lo Letohu Bara Ela..” [Perisha 5; The Taz 5/6 negates this explanation of the Perisha, as if so then it would be forbidden for her to take chemical sterilization.]
 Michaber ibid; Shabbos 111a
 The reason: The reason is because the verse states “Umauch Vekasus.” [Shabbos ibid, brought in Taz ibid, unlike Perisha] Alternatively, the reason is because the verse states “Lo Sasu” in plural. [Perisha, brought in Taz 5/5]
 Tzaruch Iyun as to the differences between “detaching” and cutting”.
 Michaber E.H. 5/12
 Chelkas Mechokek 5/6; Beis Shmuel 5/14; Taz 5/7
 See Pischeiy Teshuvah 5/11
 Chelkas Mechokek 5/6; Beis Shmuel 5/14
 See Bach; Chelkas Mechokek ibid
 The reason: [brought in Chelkas Mechokek ibid]