Sunstreaker knows to the core of his spark that he is better than any other Autobot, and he makes sure everyone else knows it, too. His sociopathic tendencies, combined with his incredible vanity and arrogance, usually result in tension between himself and the other Autobots. He is generally unwilling to help those who are having trouble keeping up, and is quite audible when it comes to complaining about the shortcomings of everyone else. The only Autobot he truly gets along with is his twin brother, Sideswipe, and even that can seem strained at times.
The main reason Optimus Prime keeps him around is most likely Sunstreaker's effectiveness in the battlefield. Ruthless and skilled in all forms of combat, there is not much Sunstreaker cannot handle. As a front-line warrior, Sunstreaker is a great asset for the Autobot army. If a rather scary one.