Another factor in the Soviet failure was that there was there was no single lunar program. Instead of focusing all of their energy on one program, like the Americans, the Soviets had parallel programs under development at the same time by different design bureaus. The bureaus had to fight and compete for resources, resulting in underfunded programs. Had they picked just one program and thrown all their efforts behind it, perhaps they would have been more successful.
That's a very good point, Chief designers Chelomei and Korolev where sworn enemies and spent a great deal of unproductive time bickering and undermining each others programs - even at a meeting with Premiere Khruschev they were unable to resolved their differences. Ultimately, Korolev managed to gain control of Chelomei's program at the expensive of over stretching himself and his departments limited resources.
Another interesting point is that soviet leadership were obsessed with automating the manned spacecraft leaving the cosmonauts with little control. The engineer Boris Chertok, in his 4 volume biography Rockets and People, talks about this in great length and points to it as a major undermining factor.
Also, the ousting of the pro space exploration Khruschev and his replacement by Brezhnev was a bitter blow, as the former had little to no interest in space exploration, and was only interesting in building ICBMS.