The purpose of eunuch surgery is to make men infertile, thus reducing the threat to the royal family and court. Historically, eunuch surgery was usually for political and military purposes, not to meet personal or physical needs.
In modern society, eunuch surgery has been abolished and considered immoral and unnecessary.