Not entirely sure why Tom Baker left Doctor Who and another one regenerated right in his place? A documentary on the new DVD for the episode Logopolis explains it pretty clearly, but you might just as well stick with just watching the episode. In the interest of full disclosure I should note that my opinion on the episode is based on not having watched the series chronologically, even as I understand some of the basic stuff surrounding the huge stakes in an actor's final turn as the Doctor from watching David Tennant's most recent season finale of the more recent show (as I also knock on wood that he'll return). But just as a stand-alone episode a lot of it is kind of mind-boggling.
To be fair, this is what makes the show more often than not a humdinger, a puzzle of elaborate rouses and little mysteries that lead to others and occasionally come back around as either/or riddles or enigmas. In the case of episode Logopolis, a time-lord is placing a kind of loop on the Tardis itself: is it in the read world or is another Tardis inside the Tardis with Doctor and the boy? Who is the guy in the white get-up and make-up save for possibly a bad mime crossed with the rabbit from Donnie Darko? Why does everyone on Logopolis used abacuses? There are plenty of head-scratching turns in the episode, and maybe even more than usual. I wouldn't want to tear my head away for a second, as exposition sometimes piled on some more, but it's hard not to have a little fun watching the ladies trying to change their tire whilst Baker and the boy try and figure what the hell is going on.
As for it being a good swan song for Baker (in his original run that is, he came back once or twice for other special installments like with one featuring all the Doctor Whos), it's... good. It's not exactly a masterpiece of a final-bow, as we see our gallant and joyfully but oddly subtle camp-faced actor dangling and falling to his doom and suddenly a revelation comes that is kind of 'meh'. But there's lots of good suspense overall in the episode revolving around entropy, mathematical comeuppances, and the usual 'taking-over-the-universe' deal which tends to happen in convoluted set-ups on the show.