Here's a curious fact... Christine Chapel accompanies Kirk in this episode. The android bodyguard, Ruk, is played by Ted Cassidy, who was Lurch on The Addams Family. Chapel, of course, is played by Majel Barrett. Ruk is instructed to protect Chapel, and to follow her orders.
In The Next Generation and Deep Space Nine, Majel Barrett played Lwaxana Troi, Deanna's mother. Lwaxana's valet, Mr Homn, is played by Carel Struycken, who was Lurch on The Addams Family.
Synopsis
The Enterprise is sent to search for Roger Korby, an anthropologist presumed dead on an icy planet. Chapel is engaged to marry him. They do get in contact with Korby, and he asks Kirk to beam down alone. Kirk brings Chapel along, and when they arrive and don't find Korby, Kirk has two red-shirts follow.
Lurch kills the red-shirts while nobody is looking, and it's quickly revealed that Exo III is a den of androids and Korby is the ringleader. Kirk makes Korby tell Lurch to protect Chapel, and to follow her orders.
Korby makes a robot double of Kirk (who we'll call Klanker) to help with his master plan: to take his android-making equipment to a colony world, so he can start turning people into androids. Klanker beams up to the Enterprise, but Spock sees through the deception—he doesn't know what the deception is, just that something weird is going on.
Kirk gets beaten up by Lurch, but later on asks Lurch what really happened to the Old Ones who built him. Lurch says that the Old Ones went all Animatrix on them, so they were forced to kill their creators. Kirk tells Lurch that Korby is repeating history, and in the confusion, Korby is forced to destroy Lurch.
The hot chick android mistakenly destroys Klanker, and it's revealed Korby transferred his consciousness into an android body. The transfer was lossy, and that's why Korby has turned into such a dick. Korby has a final moment of humanity, and destroys himself and hot chick android.
Commentary
The 60s were, frankly, more aware of the reality of computers than we are today. There's also a very nice episode of The Prisoner, "The General," with a similar take—on the fundamental incompleteness of computers as "thinking machines."
The inadequacy of AI is a bigger topic than I can fit here. I will say, I don't actually mind Data, not least because his characterization takes this episode's premise from the other direction. The Next Generation makes it abundantly clear that Data's "human-ness" is a façade, an illusion, especially when we get to "In Theory" (TNG 4x25). That's also why "The Measure of a Man" (TNG 2x09) doesn't make my list of very special episodes, despite being one of the most famous episodes of the entire franchise.
Likewise, I love Robert Picardo's performance as the Emergency Medical Ham, but I don't care for their half-baked attempt at remaking "Measure" ("Author, Author," VOY 7x20). Picardo puts on a consistently great performance, but by then I think Star Trek got lost too far up its own ass when it came to AI.
The transition from Korby to Data is like the transition from the artificial neural networks and logistic regression of the 60s, to the deep learning of today: the illusion is more convincing, but if you find yourself at a magic show watching a woman being sawed in half—don't call the paramedics.
Yeah I couldn't help myself, once I remembered that the stucco dick was from this episode.