The Star Trek: Voyager series begins with the ship and crew being catapulted across the galaxy. In that initial disaster, the ship's only doctor is killed and they are left without a chief medical officer or even medical staff. Fortunately, the ship had been the recipient of an experimental program, an "emergency medical hologram," a kind of medical AI given material form through holographic projectors and forcefields. Although never intended for long-term service, "the Doctor" evolves over the course of the series from begrudgingly taking on the duties of a chief medical officer to pushing the limits of what he is capable of.
By the time of Tinker, Tenor, Doctor, Spy, Voyager has been heading home for six years, and the Doctor is now on the point of demanding better treatment by the crew and the right to expand his programming to include additional functionality. His proposal is to become an "emergency command hologram" as well, capable of taking over the ship if the captain and senior staff are ever incapacitated or otherwise compromised. The captain rejects this request in one of the episode's opening scenes.
In addition, the Doctor has been doing his own tinkering—he has given himself the ability to daydream. His daydreams alternate between him saving the crew from death and destruction, to the female crew members fighting with one another over his attention. All are successful comedy, and the cast does a phenomenal job hamming it up. Even Majel Barrett, the voice of the ship's computer, gets a turn at driving home the ridiculousness of the Doctor's delusions of grandeur.
Adding further thematic force is an alien species calling themselves the Hierarchy. As their name implies, their society possesses a very rigid structure. Each individual possesses a role, which they can step outside of only to their peril. Their contrast to the Doctor's struggle to better himself and expand his role on Voyager rounds off the episode well.
The major theme at the core of the episode isn't particularly profound—we can all improve ourselves given effort, and our success in doing so depends largely on how well we rally our family, friends, and allies to our aid in those efforts. However, the real magic of Tinker, Tenor, Doctor, Spy is in the way it adeptly utilizes series-long character dynamics of the Doctor's development as a sentient being and his struggle to build interpersonal relationships with the rest of the crew.