Pretty sure ancien kingdom weren't capitalism.
Hell, money in the M-A was barely developed.
But still, people were worried about them and their close peers, and nothing else.
So you need a small, really patriotic country to make things works in communism.
Or uh...
An army.
Also, good point about capitalism, but you need to contribute first to have your reward. Greed is always rewarding cause you get more in any case, but here we put a carrot on a stick to motivate people to do things.
Which yeah, exploiting greed is a risky solution, and not the best one, but nonetheless it works.