No one knows for sure why K-129 was lost with all hands on board. The official Soviet line at the time was the submarine exceeded its rated depth limit while snorkeling, most likely due to some failure that caused K-129 to dive and the inexperienced crew was unable to recover.
There are other theories, like a hydrogen (from the batteries) built up and wasn't properly vented, causing the explosion, another theory is that a missile somehow cooked off and exploded and yet another theory is that K-129 collided with USS Swordfish but that theory is unlikely. Pictures of damage to USS Swordfish (bent periscope and dented sail) was highly inconsistent with a collision that would have breached the hull of another submarine would have caused far more extensive damage to Swordfish's sail.
What is interesting is that the K-129 is one of four submarines lost due to unknown causes, the other three were INS Dakar (Israeli), Minerve (French), and USS Scorpion. What makes all four of these interesting is that all four submarines were lost in the first 5 months of 1968.