Was Daniel castrated because he was an official in the palace of the king of Babylon?
While the bible does not give detaikl on this, all the evidence points to the fact that Daniel was probably castrated.
First this was a very common practice of this era. They castrated young captivites and put them to work either in palace or in other tasks.
Castration served two purposes, they could be trusted around Babylonian women and castration at a young age usually resulted in a large powerful body.
Second we see Daniel and his three friends under the control of the chief of the enuches. While it is possible they were put there while yet whole it is very unlikely.