“And you shall not do it in your land!” (Vayikra 22:24)
It is a negative commandment that we may not sterilize any of the species, be it human, animal or bird, as immediately after the prohibition to offer a sterilized animal in the temple it says “And you shall not do it in your land!”, and this prohibition includes humans, animals and any other living creature.
Amongst the roots of this commandment are that since Hashem created His world in the ultimate state of perfection, He did not put anything extra nor was anything missing of all that was fitting to be there to contribute to that perfection, and since it was his will that living creatures would be fruitful and multiply, and he also commanded human beings to be fruitful and multiply for if they would not, the species would become extinct, since death would finish them off. It follows that one who sterilizes a living creature shows that he is disgusted by Hashem’s creation, and wants to destroy His good world.
Amongst the laws of this commandment are that it is forbidden even to ask a gentile to sterilize an animal. If, however, the gentile sterilized the animal of his own accord, one is allowed to buy it from him and eat it. If, however, a Jew did a trick and hinted to a gentile to sterilize an animal, then Chazal fined him that he may not eat it. Instead, he must sell it to another Jew. He may sell it even to his own son if he has reached adulthood, but not if he is still a child.
This prohibition applies only to sterilizing males, but not to females. If one sterilizes a female, whether human or other species, although it is forbidden, one does not receive a punishment.
This commandment applies in all places and at all times, both to men and to women. (This means that women are not allowed to sterilize men, but sterilizing a woman is not included as has already been explained.)