Socialism would work in a society where everyone was perfect.
Even if people were morally perfect, our limited knowledge would make a functioning socialist polity bigger than a few dozen people impossible.