The Doctor is a flawed being. He makes mistakes yet he is learning that the universe is fluid and he has the power to effect change even within himself. Rigid thinking is a trap and an unrealistic construct of a fearful mind. In reality everyone has the the power to change our minds. Nobody is concrete and must adapt to situations as they evolve and change around us. The dream of an aged Clara, of an opportunity lost, is a gift for the Doctor for he is telling himself that abandoning her is a mistake he will come to regret. Claras life is not empty without the Doctor. She teaches and travels and lives well. She leaves the dream because she is aware that while she may not need the Doctor to live a fulfilling life, he does need her to keep himself in check. He brings grand experience and excitement to her life in turn. They are good together. They make each other better people. Thats all anyone can ask from any partnership.