לזכות אברהם מרדכי בן נעכא גיטל שיגדל להיות אחד מן הגדולים אשר בארץ
The mishna says that if a person's wisdom exceeds his deeds he is like a tree with many branches and few roots. When a wind comes it blows it over.
When a person is not doing the right things in life he has two options. He can either admit that he is succumbing to his base desires, laziness etc, etc, or he can say that the whole thing is not true. I have observed this many times. When someone says that it's not true then he is off the hook and has to suffer no guilt [on a conscious level - there is much repressed guilt I believe]. If he admits that he is at fault then it is a personal incrimination that is very painful.
When a person has wisdom he understands the gravity of his life and his deeds. If he is not living the right way all of his wisdom is going to "blow him over" and cause him to deny the truth. The gemara says [brachos 8a] that if one is not subordinate to his Rebbi he should move away from him. If he doesn't then his wisdom will increase without his deeds and that is dangerous.
The reason that Sarah expelled Hagar was because Hagar was not willing to subordinate herself [ותקל גבירתה בעיניה]. Sarah was 100 percent correct in doing so because it is dangerous to have such a Rebbetzin like Sarah as your guide and to choose not to listen.
This does not necessarily contradict the Ramban and who says that Sarah was punished for expelling Hagar. One one hand she was justified but on the other hand bein adam lachaveiro is like fire. If one comes into contact with fire he gets burned even if he had every justification for doing so.... [See more about this idea, here]
עיין בפחד יצחק שבועות מאמר מה, ובספר היקר להעיר להורות ולהשכיל ח"א עמ' קעא וחלק ג עמ יז ושם תמצא נחת