Why have attempts at communism failed?
It isn't just greed that makes communalism unworkable but the differences in human character and the differences in human capabilities. Some people are lazy. They like to see others do all the work while they share in the results. People who are capable and hard-working get tired of doing more than their share. The workhorse in George Orwell's Animal Farm is a good example of the humans who do all the work in socialist societies, while the pigs are good examples of the opposite kinds of humans. It is nearly impossible to have communalism even on a small scale because some people will naturally take responsibility and leadership while others will want to enjoy the benefits of sharing without actually doing any sharing.
B. F. Skinner's novel Walden Two depicts a utopian society designed on a small scale. Everybody does their share of the work cheerfully and diligently. Therefore nobody has to work very hard, and everybody enjoys leisure and comfort. Skinner, a famous psychologist, just took it for granted that everybody would think and feel exactly the same.
In a book titled A Walden Two Experiment, the author Kathleen Kinkade describes how such a commune works in actual practice. Some people work and others loaf. One woman says she is good at having babies but not much good at taking care of them--so she assumes that others will take care of her children and thereby they will be sharing equally. One person will cook, clean, and wash dishes; another will contribute by playing the guitar.
One good example of a commune was Jonestown, where the leader Jim Jones persuaded his followers to kill their children and commit suicide, leading to over nine hundred deaths. What caused the massacre was that some people wanted to leave the community and were not permitted to do so.
In a sense, one could say that communism, as envisaged by Marx as a global post-capitalist post-nationalist system has never really been attempted. Instead, certain elements of Marx's economic theories were put into practice by nations that were primarily poor and agricultural. Their attempts at planned economies were grounded in theories that presumed a highly industrialized starting point with a large economic surplus. Neither Russia nor China had these preconditions, and so rather than being able, as Marx would have recommended, to redistribute a surplus, instead they were struggling to supply basic necessities.
The other major problem, and possibly one that cannot be surmounted, is greed. The ideal of collective ownership, and equitable distribution, presumes that people are not greedy and that everyone is willing to abide by a sense of fairness and not use positions of authority to accumulate luxuries while others starve.