This is something that has mulled me for a long time.
Even though Ego is a vice and Humility is a virtue and you would think they are complete opposites and have nothing to do with each other. I have come to the realisation that these two are related to each other.
I see them on a see-saw in that if one of these goes up, the other one goes down.
However, I think the ego is another necessary vikaar (it does serve a function) because too much humility can make one like a doormat.
These two need to be seen in their contexts and they need to be balanced like yin and yang.