The castration of young boys for the sake of musical art has a long and sad tradition. Although Chinese and Muslim traditions have records of men choosing to be castrated so that they coulkd get administrative posts in Palaces with harems it is unlikely that child singers were given much choice. The Wikepedia articl on the subject gives:
"A castrato is a male soprano, mezzo-soprano, or alto voice produced either by castration of the singer before puberty or one who, because of an endocrinological condition, never reaches sexual maturity.
Castration before puberty (or in its early stages) prevents a boy's larynx from being transformed by the normal physiological events of puberty. As a result, the vocal range of prepubescence (shared by both sexes) is largely retained, and the voice develops into adulthood in a unique way. As the castrato's body grew, his lack of testosterone meant that his epiphyses (bone-joints) did not harden in the normal manner. Thus the limbs of the castrati often grew unusually long, as did the bones of their ribs. This, combined with intensive training, gave them unrivalled lung-power and breath capacity. Operating through small, child-sized vocal cords, their voices were also extraordinarily flexible, and quite different from the equivalent adult female voice, as well as higher vocal ranges of the uncastrated adult male (see soprano, mezzo-soprano, alto, sopranist, countertenor and contralto). Listening to the only surviving recordings of a castrato (see below), one can hear that the lower part of the voice sounds like a "super-high" tenor, with a more falsetto-like upper register above that.
Castrati were rarely referred to as such: the term musico (pl musici) was much more generally used; another synonym was evirato (literally meaning "unmanned").
Castration as a means of subjugation, enslavement or other punishment has a very long pedigree, dating back to ancient Sumeria (see also Eunuch). In a Western context, eunuch singers are known to have existed from the early Byzantine Empire. In Constantinople around 400 AD the empress Eudoxia had a eunuch choir-master, Brison, who apparently established the use of castrati in Byzantine choirs. Whether Brison himself was a singer, and whether he had colleagues who were eunuch singers, has not been definitely established. By the ninth century, eunuch singers were well-known (not least in the choir of Hagia Sophia), and remained so until the sack of Constantinople by the Western forces of the Fourth Crusade in 1204. Their fate from then until their reappearance in Italy more than three hundred years later is by no means clear, though it seems likely that the Spanish tradition of soprano falsettists may have "hidden" castrati (it should be remembered that much of Spain was under Arab domination at various times during the Middle Ages, and that eunuch harem-keepers and the like, almost always taken from conquered races, were a commonplace of that society: by sheer statistics, some of them are likely to have been singers).
Castrati, many of them having Spanish names, first appeared in Italy in the mid-sixteenth century. Alfonso II d'Este, Duke of Ferrara, was an early enthusiast (by 1556). There were castrati in the court chapel at Munich by 1574, where the music director was Heinrich Schütz, and it is likely that Palestrina, director of the choir of St Peter's Rome from 1576 to 1594, would have been keen to emulate his famous contemporary. In 1589, by the bull *** pro nostri temporali munere, Pope Sixtus V re-organised that choir specifically to include castrati, and in 1599, they were first admitted into the Pope's personal choir of the Sistine Chapel: Pietro Paolo Folignato and Girolamo Rossini (it is likely that others, such as Padre Soto, appointed in 1562, joined earlier under the euphemism "falsettist"). Thus the castrati came to supplant both boys (whose voices broke after only a few years) and falsettists (whose voices were weaker and less reliable) from the top line in such choirs. Women were of course banned by the Pauline dictum mulier taceat in ecclesia ("let your women keep silent in church"; see I Corinthians, ch 14, v 34)."