There is more than one form of crastration. There's testicular and penlle. The Unsullied are not castrated totally. This even comes up in the show what D asks her handmaiden if it's the root and the trunk or just the root. she replies, "I do not know."

But in the books,t here's a mention of it as some point and it makes it clear that it's just the testicles. Which was thought to have a focusing effect on the discipline of the soldiers. And while it does affect sexualality, it doesn't do so totally. In other words, a person who was had their testicles removed could very well be more or less sexually normal. They can still achieve erections and will ejaculate. (Just without any sperm.) 

There are some famous US cases of rape offenders being castrated in this way, then being released and surprising everyone by committing rapes again.