Why did the Soviet Union give up on a moon landing?

To accomplish a manned moon landing, various forms of hardware was required. A crew, living facilities, landing craft, earth return vehicle and the fuel for a full return trip. This a requires a rocket, a mighty rocket. The full answer is given in the book. But here is a fairly obvious hint to answering the above question...

The Soviet N1 Moon Rocket 1969. They never did get it to work! 

The first US Saturn V Moon rocket - Apollo 4 launch 1967. Worked every time!