Regardless of which continuity I have seen so far (aligned and also a few of its predecessors), <PERSON> joined the Decepticons while betraying his old allies.
<PERSON> himself is not dumb though. He knows 2 things. First that <PERSON> will always stay loyal even if he is not promoted. Second that <PERSON> is power hungry and traitorous AND useful (to some extent). So what position is best than 2nd in command for him?
In this position <PERSON> can watch him, while <PERSON> feels important. Additionally <PERSON> can watch <PERSON> without the later trying to assassinate him to obtain the 2nd in command position (which <PERSON> would else do sooner rather than later......he even tried time and again to assassinate <PERSON> himself to gain even more power). 865
And <PERSON> thus is in a position where he can warn <PERSON> or sabotage <PERSON> attempts to undermine/do away with <PERSON>.
Also for <PERSON> the feeling important thing is quite important. He has such a strong ego that he needs that, in order to do his duty and ONLY betray his allies when pushed (else he would do so on a whim of a hurt ego even as seen a few times in different continuum episodes).
So all in all the 2nd in command is the best solution <PERSON> can come up with. As it brings him a capable warrior, someone he can punch and who comes back to still serve him while minimizing the risk of <PERSON> plans to gain command of the Decepticons. And as soon as <PERSON> is no longer more of an asset than a liability.....he will go the way of all things that displease <PERSON>.
What really is a wonder though is that <PERSON> thinks that Starscreams abilities/plus points outweigh his incompetence/failures. And thus that <PERSON> still lives (despite him always loosing). With Megatrons tendency to even kill loyal failures.....that is something of a mystery there though (and as far as I know not explained in any way in any continuum).
Additionally in many of the continuums <PERSON> somehow seems to be amused by <PERSON> AND his attempts to ursurp his position (although this is only an observation and interpretation, thus not part of the answertext above).
Edit: I found something as to why <PERSON> is not killed by <PERSON> and also what adds to his usefulness (and thus in the end why he ends up in the 2nd in command position). As stated in another question from here: http://scifi.stackexchange.com/questions/49134/why-didnt-megatron-kill-starscream-in-g1?rq=1 According to an answer there by Wikis <PERSON> is not as much a failure as I myself always perceived, but instead very good at his job. 865