To keep them from temptation.
The short answer is that while most soldiers in the world of Game of Thrones appear to be rapists, the Unsullied neither rape nor plunder. Their castration removes temptation which could impede their efficiency. For a much more detailed answer, I refer you to the books. All quotes below are from A Storm of Swords, Chapter 23 (Daenerys), and all emphasis is mine..
First Daenerys asks the slave-owner exactly the same question you did, and he dodges the question by boasting that although castration makes them less strong, they make up for it with their discipline:
“Why do you cut them?” she asked Kraznys through the slave girl. “Whole men are stronger than eunuchs, I have always heard.”
“A eunuch who is cut young will never have the brute strength of one of your Westerosi knights, this is true,” said Kraznys mo Nakloz when the question was put to him. “A bull is strong as well, but bulls die every day in the fighting pits. A girl of nine killed one not three days past in Jothiel’s Pit. The Unsullied have something better than strength, tell her. They have discipline. We fight in the fashion of the Old Empire, yes. They are the lockstep legions of Old Ghis come again, absolutely obedient, absolutely loyal, and utterly without fear.”
Later in the same conversation, though, the question is answered:
“In Yunkai and Meereen, eunuchs are often made by removing a boy’s testicles, but leaving the penis. Such a creature is infertile, yet often still capable of erection. Only trouble can come of this. We remove the penis as well, leaving nothing. The Unsullied are the purest creatures on the earth.” He gave Dany and Arstan another of his broad white smiles. “I have heard that in the Sunset Kingdoms men take solemn vows to keep chaste and father no children, but live only for their duty. Is it not so?”
“It is,” Arstan said, when the question was put. “There are many such orders. The maesters of the Citadel, the septons and septas who serve the Seven, the silent sisters of the dead, the Kingsguard and the Night’s Watch . . . ”
“Poor things,” growled the slaver, after the translation. “Men were not made to live thus. Their days are a torment of temptation, any fool must see, and no doubt most succumb to their baser selves. Not so our Unsullied. They are wed to their swords in a way that your Sworn Brothers cannot hope to match. No woman can ever tempt them, nor any man.”