Graff had isolated Ender to make him struggle. To make him prove, not that he was competent, but that he was far better than everyone else. That was the only way he could win respect and friendship. It made him a better soldier then he would ever have been otherwise. It also made him lonely, afraid, angry, untrusting. And maybe those traits, too, made him a better soldier.
Do you know why Satan is so angry all the time? Because whenever he works a particularly clever bit of mischief God uses it to serve his own Rigteous purposes.""So God uses wicked people as his tools?""God gives us the freedom to to do great evil, if we choose, then He uses his own freedom to create goodness out of that evil, for that is what He chooses.""So, in the long run, God always wins?""Yes, in the short run though it can be uncomfortable.