If I recall, it is written in Deuteronomy that “No man who has had his testicles removed, either by crushing or by cutting, shall enter into the assembly of the Lord.” I also remember that many of the heathen peoples in Canaan would have men castrate themselves as a sign of devotion to the heathen idols. Therefore, one could rationalize that the Lord (is it okay if I spell that out all the way?) implemented this law as a way to keep the Hebrews separate from the heathens.
But supposing someone was involuntarily castrated, such as during a war or as a result of forced sterilization? Does this make them just as ineligible, or is that law only for voluntary, ritual castration?