The USSR was a command economy, the government decided what would be produced not the free market. Command economies almost always have a mismatch between supply and demand that is not corrected for because the central government is unable to anticipate what people will want and is slower to react than a free market model where prices change and incentivize more or less of a good.
A modern example is North Korea, their government has decided to spend more resources on weapons than food. Their grocery stores are nearly empty and there is a huge demand for food but the supply doesn’t increase because the government wants weapons.
Edit: https://www.investopedia.com/ask/answers/050615/how-did-soviet-economic-system-affect-consumer-goods.asp
Edit 2: The US economy very rapidly outpaced the soviets and while the US could afford fund massive defense projects and spend lots of money without compromising its economy, the soviets could not. Their economy was inefficient and only got worse as they tried to compete with the US allocating more resources to things their people didn’t need. Then in the 90’s and 2000’s after the collapse, today’s oligarchy structure formed and the russian federation is now a [petrostate](https://en.m.wikipedia.org/wiki/Petrostate) under a dictatorship, with very low social mobility and with [dutch disease](https://en.m.wikipedia.org/wiki/Dutch_disease) crippling other industries.
Latest Answers