The TARDIS intervened
Although we don't often think of the TARDIS as a sentient character, she is (and has been known to be since the very earliest stories, too). And is later stated explicitly, she sometimes takes the Doctor to places that aren't his intended destination simply because the place he ends up is, in some sense, better for him.
One of these occasions interrupted the Doctor at the time when he should have been going back to collect <PERSON>. At the end of The Hand of Fear (bad name, and unfortunately not the greatest episode either), <PERSON> is annoyed with the Doctor and looking forward to some time away from him:
DOCTOR: Forget the zeus plug. I'll have the sonic screwdriver.
<PERSON>: Oh, and boy am I sick of that sonic screwdriver! I'm going to pack my goodies and I'm going home. I said, I'm going to pack my goodies and I am going home! Right! Excuse me! (<PERSON> storms out of the console room.)
But after stating that she doesn't actually intend to leave, the Doctor says he has to leave her behind while he visits <PERSON>. But he is, by all appearances, intending to come back for her later:
<PERSON>: Don't forget me.
DOCTOR: Oh, <PERSON>. Don't you forget me.
<PERSON>: Bye, Doctor. You know, travel does broaden the mind.
DOCTOR: Yes. Till we meet again, <PERSON>.
He then goes to Gallifrey as promised, and has a rather unusual companion-free adventure (The Deadly Assassin, not a great title but a much better episode). 663
After that is over, he is apparently intending to go back for <PERSON> (he is, at the very least, aiming to get to London, which is at least approximately where he left her), but the <PERSON> sends him elsewhere (in the absolutely terribly named but really quite good The Face of Evil):
[Forest]
(Animals call in the night, and a cybermat shaped thing with a small forked tail slithers along the sandy ground as the Tardis materialises amongst dead looking trees. The Doctor steps out, looks around, and speaks to the camera.)
DOCTOR: I think this is not Hyde Park. Could be a nexial discontinuity. Must remember to overhaul those tracers. Put a knot in my hanky.
(His hanky already has a knot in it.)
DOCTOR: I wonder what that was for. Little look round, Doctor? Why not.
He does, of course, end up with an adventure. And a new companion. And in the excitement, he clearly forgets about going back for <PERSON>. But why did the <PERSON> send him there? It's never explained, but it could well be that it does so to protect <PERSON> from spending too much time with him.
(Transcripts from http://www.chakoteya.net/DoctorWho/) 417