ego serves its own purpose. if its given, it would have been given for some purpose like everything else like sexual pleasure given for reproduction which is very necessary part of this living world; taste pleasure for eating for our survival. May be ego is given for self defence. Can you guess?