Pretty much everything has already been said, but Xehanort wants a balanced universe. He believed the first Keyblade War resulted in a world fated for failure; light was far too prevalent, darkness was nearly excluded, and those that used darkness did so recklessly. He had no respect for beings like Maleficent, simply seeing them as fools, but decided to control and manipulate their darkness for what he saw as the greater good rather than outright eliminate them.
Playing through the game, I actually think Xehanort had a pretty unhappy childhood. Woody believes that no one ever loved Young Xehanort. This form was before he left the Destiny Islands, so his childhood was probably a contributing factor for him longing to leave the islands and made his heart more susceptible to darkness. This makes me believe that he used corridors of darkness to travel throughout the worlds and learned of the power of darkness as a result, eventually meeting a master of the keyblade, who decided to train the boy because of his strong heart.
He meets Eraqus at this time, a "blueblood" descended from the ancient keyblade wielders who he eventually saw as a brother. This period of time is the only time we see Xehanort acting as carefree and genuinely nice individual; I think it's because he finally has someone to care about and vice versa. However, Eraqus' beliefs in light being absolute, coupled with Xehanort's new findings into the Keyblade War, made him look at Eraqus as a reckless fool and their friendship was shattered.
From there, he was consumed with his ambitions; create the X-Blade to reenact the Keyblade War, complete Kingdom Hearts, take control of it and transform it into pure darkness and use it to purge the worlds and recreate them into a single existence that is balanced of light and darkness. To ensure no one misuses the light or darkness again, he would then lead and control this new world and dictate everyone's destinies. With the knowledge and power he would obtain, he would be immortal to rule over the world for eternity. He still believes that darkness is the heart's true essence because everything begins and ends in darkness, but also believes in the light, which is born from the shadows; they just need to be balanced out and maintained.
The only aspect that Xehanort did not mention is his lust for knowledge, but as others have said, he was trying to justify his horrible deeds throughout the series and did not want to openly admit that a large portion of his plans were because he wanted to leave his own mark on the world and the history of the Keyblade. He had a sense of entitlement to the X-blade and Kingdom Hearts, but if he believes in destiny, than he realized that it was not his destiny to lead after all. His disbelief in Sora defeating him was not only because he couldn't believe that he was defeated, but the realization that he is not worthy after all to usher in the new world. Thus, he accepted his destiny and allowed Sora and his friends to decide their own fates in the world.
The Xehanort we knew throughout the series was destroyed (quite a bit if you count his other forms being taken down in the Keyblade Graveyard) and we are left with the one Xehanort that was actually a good person, even if it was only for a very brief period of his life, departing with the one person that ever showed any concern for him; his brother. It's fitting that Eraqus is the only person to feel sorry for Xehanort because he knew him as a brother.