Socialism as we know it failed because it tried to impose equality from top down—an idea with tragic consequences, as we saw the millions upon millions of people dead in the Soviet Union during the reign of Josef Stalin and China during the reign of Mao Zedong.
It won’t work because, well, from an earthly point of view some people had to be “more equal” to have the authority to oversee it all.
In a system where people are sincerely believing on God, the authority is in God and the mediator is the action of God on the conscience for the most part. This leaves people to be able to be equal in the sense they are equal before God, not equal in worldly stature. This is why the Cold War actions of the West so strongly stressed “In God We Trust.” Whether a mere slogan moved the West, is less clear — more evangelism and less sloganeering might have been the better order of the day. But people did see the need on some level.