When all major foreign powers say that they wish for the destruction of your country and would openly prefer you to go back to more suffering, support for monsters like Stalin increases.
Equally, when the threat of invasion is as high as it was for the USSR from Britain and the US, a lot of money and power is invested in the military.
It's very possible that if it wasn't for massive foreign interference neither Stalin nor Trotsky would ever have been able to gain much power (both of them got their power from military conflict mainly, Stalin even moreso), the NKVD never would have gotten nearly as much funding, Lavrentiy Beria would probably have been put against the wall, and so on.