Socialism doesn't eliminate greed—it redirects it from market competition to political competition. The latter is far more destructive.
The common mistake people make when criticizing capitalism is the forget that you can't really eliminate greed with an economic system. You can at best minimize its damage and maximize its benefits.