People always assume Byzantine or eastern Roman means Greek but it was Greek in civilizational terms. Many of the dynastic families and court officials were Armenians and the eunuch practice probably originated amongst the Armenians.
The eunuch was used to ensure that the person in office had no children with a vested interest.