It's human nature to be greedy. It comes from hard realities, like needing to eat. It grows because success is a powerful drug.
Capitalism isn't based on greed, it just happens to be a copacetic match to our nature, similar to how the other enlightenment ideals are a copacetic match (have to include Adam Smith with Locke, Hume, et al).