Ego, as defined in Sigmund Freud's psychoanalysis, is generally considered a bad thing in today's society. People reproach others saying he/she has too much ego.
But Ego is the only thing which drives this world forward. I think it is result of evolution, it still exists today, which emphasis that Ego must have helped human beings in their survival. Evolution of brain led to origin of Ego which can be linked to origin of sconsciousness. Consciousness must have arisen later in human evolution.
If you look at world history, most of the big events (whether good or bad) were led by Ego of an individual. If you look into how Mao's China and its after effects like cultural revolution came into being, its largely due to the ideas which Mao had and his will to act on it. Hitler led to the formation of Nazi Germany.
The society doesn't evolve along normative principles, but what individuals believe should be done and take the risk to actually do it. All these individuals must have a high does of "Ego", as it is used in current terminology, otherwise they wouldn't have led to changes/achievements which they did.
Elon Musk has created a rocket which returns back to the earth after delivering its payload. He is planning a colony in Mars. All this is driven by a human, who thinks of himself as a separate entity - his ego. In words of Elon Musk, he wants to be hopeful about future and thats why he is doin all this.
Ludwig von Mises alludes to this in his book Human Action in which he says that human action (drive to a better condition of being) is the ultimate source of all decisions/"actions".
So, next time when you start criticising Ego, think again and ponder about how evolution of Ego has led to development of our society.