Here is why that ultimately became communism's death blow:
1. It made the USSR look foolish.
2. It made the USSR look weak.
3. It made the USSR look like wasteful idiots.
These are the things that lead to the downfall of a regime.
With that Moon landing thing Soviet regime indeed managed ridicolous themselves such level that people didn't anymore scare them but begun threat leadership just joke which should oust quickly.