A lot of factors.
Russia was way behind the west in terms of industrialization before the revolution. So they faced the challenge of trying to shift to a mass mechanized production society.
Because they took power through a violent coup, they quickly became authoritarian to put to dissent, like pretty much all countries that experience a violent coup against a previous system do, regardless of whether the new government is communist, capitalist, Islamist or whatever.
Authoritarian governments have a lot of real and perceived and potential enemies within and without, so a lot of resources, go to fighting that dissent, and a lot of opportunities for collaboration and resources are lost. The USSR, for instance, was cut off from a lot of trade from parts of the west, either by policy or principle, so they had tons of opportunity cost.
Such authoritarian governments breed corruption. Scarcity is sort of a self sustaining cycle. When goods are scarce, people learn to steal and cheat to get what they want and need. And that makes things more scarce and reinforces the corruption. Russia was authoritarian and corrupt as a Tsarist feudalist state, and as a communist state and now as a capitalist state.
Cold war competition with the US funneled even more resources away from local needs. Military build up, proxy wars, and show-off competitions like the space race were massive drains.
People are correct to point to the problems with command economies having bad incentives and not adjusting to demand like market economies, but honestly, the USSR would have had major shortage issues even without that for all the reasons above.
Latest Answers