There were many reasons why Trotsky should have become leader, his work had been invaluable to the communists coming into power with the November revolution and retaining it later in the civil war but Trotsky did not go all out to get support in the way that Stalin did and had made himself many enemies in his very far left-wing beliefs. And his belief in 'permanent revolution' so spreading communism to other countries while Stalin wanted to increase the USSR's power first, he wanted to concentrate on economic revival, he wanted to reform the USSR. Trotsky also was quite arrogant and had not joined the Bolsheviks until 1917, he had been a Menshevik, and he wanted the new economic policy that had been brought into effect by Stalin to be stopped. Trotsky also had little support in the Politburo, and anyone who opposed Stalin in the Politburo was soon dismissed because of the influence Stalin had gained and because he had been promoted to General Secretary of the Communist State in 1922, he could control people admitted into the party as well.
In 1924 Stalin was elected leader of the party and in 1925 Trotsky was expelled as Commissar of War. Then Stalin made an alliance with Zinoviev and Kamenev to get rid of Trotsky but in 1927 Stalin allied himself with Bukarin and the right and defeated Zinoviev and Kamenev and expelled them from the party and by 1929 Trotsky was expelled from the country. Only a few other communists were left to challenge Stalin. Trotsky had been seen as a rival and a threat and by 1928 Stalin had effectively in overall control or the USSR because he was in an unchallenged position especially after defeating one of last rivals a more right wing communist, Bukarin. So much was Stalin's hate of Trotsky that he had him assassinated in Mexico in 1940, Stalin had still felt him a threat.
Stalin also used a lot of propaganda to stop Trotsky becoming leader, he even didn’t tell Trotsky the date of Lenin's funeral to make him seem to lack respect for 'The Old Nurse's Story' communist leader. Stalin removed him from photos, and made himself out to have been Lenin's right hand man which truly was Trotsky.
I think the main reasons why Stalin became leader instead of Trotsky were his influence in the politburo and his skill at getting rid of the opposition. He threatened people what he would do to there families and made sure many people left, or he got other members of the party to turn against them so they were dismissed. He made himself out to have been a great hero during the November revolution and to have played a crucial role and he used fake propaganda about that time to get rid of Trotsky his main rival and to make himself seem a better candidate for the job. Also although Trotsky was great at planning a brilliant orator he lacked the ability to make people like him like Stalin did and his strong beliefs in the end made people dislike him and not support him.