Many Communists saw the NEP as a retreat from Communist Ideology. It was seen as a promotion of private ownership, trade and profit, as well as being responsible for the rise in new "petty bourgeoisie" classes such as NEP men and Kulaks. It was seen as a policy that promoted the interests of the peasantry, a group that were seen as generally capitalist and potentially threatening to the pace of revolution. Thus a policy of increased state control of industry and commerce would rid the state of these contradictory classes.
It would push Russia further onwards in terms of a state free from private trade and ownership. However ideology is often seen as Stalin's weak point however, since he is often thought of as frequently changing policies to further his political aspirations. The leadership challenge of 1925 – 1928 showed how Stalin changed his policies to decimate both the left and right wing of the party and strengthen his position over the party, by varying his beliefs in order to outmanoeuvre his political opponents.
On the other hand, some historians (such as Viola) argue that the NEP was causing extensive discontent within the party, and that rather than being as capricious as is often presumed, he can be seen as a pragmatist in the face of the will of the party. His "Great Turn" can be seen as a realistic and attractive policy, suited to the rank and file of the party, that he did not adopt earlier in the 20's since it was not a fitting policy at the time.
The problems in ideology could be seen to link to the problems with agriculture as it was the Kulak class that Stalin held responsible for hoarding the grain and demanding higher prices for it, thus if the ideology changed to rid Soviet society of such elements, then haste could be seen to be of importance. However this was not the only problem with Russian agriculture. Farming methods were fundamentally backwards and unproductive, to the extent that parts of Russia were up to 500 years behind Britain.
Furthermore the peasantry, who had little notion of communist ideology, could hold the government to ransom under the conditions of the NEP, since they controlled agricultural production. This situation was undesirable in a country so reliant on agriculture for its industry, since grain needed to be procured to provide capital investment to fund industry, and also to feed the urban workforce.
Thus if Stalin was to avoid another grain procurement crisis, as had happened in 1928, it could be argued that he needed to take a hard line, both to push forward soviet industry (which was inextricably reliant upon agriculture) and to break the hold that the peasantry had over him. This could be further linked to ideology since in terms of Marxist thought, a socialist state can only be developed in a highly industrialised state and he was taking measures in agriculture to develop industry.
Moreover the mechanisation of agriculture that Stalin suggested can be said to promote Communist ideology since it would free up farm labourers to migrate to the cities where they could become part of the industrial workforce that was an absolute necessity for a true Communist state. Additionally the international climate, which Stalin found himself in during the late 1920's, was far from ideal.
Britain and Poland had broken off diplomatic relations with Stalin, as well as Chinese Nationalists attacking Communists. These were combined with existing fears that the West were set on destroying Communism, after they gave the Whites assistance during the Civil War. On encountering the choice between speeding up modernisation, thereby increasing military strength, and remaining vulnerable and at the mercy of the peasantry (as the Tsar found himself in 1916 after grain shortfalls).
If this situation was, as some historians argue, the case then Stalin stood up to the challenge and took decisive action, thereby initiating his "Great Turn" more quickly to deal with a hostile political climate. Therefore I conclude, that the need for security from invasion acted as a catalyst, in initiating Soviet reform of agriculture and ideology, although without the distinct inefficiency of Soviet agriculture or the mass discontent at the NEP, then this would not have been the case.