The Soviet Union was an economic disaster for a long time. During the space race, which was ultimately a fight about economic systems, NASA’s budget was 0.7% of the US GDP but the Soviet Union was spending up to 15-20% of their GDP to “keep up with the Joneses” (the exact figure isn’t known because they lumped everything into military spending).
They were dirt poor and were throwing an extreme amount of money at looking rich for decades and eventually it caught up with them.
Like the people who take out giant loans to lease an expensive car above their means.