Any computer worth a damned would dismiss any illogical statement or premise put to it, rather than pursuing to understand it without end until it self-destructs. That's why the whole Norman android defeat is so silly... but then, it's a lighthearted episode anyway, not to be taken seriously.
Nomad previously corrected imperfections in machines by improving them instead of destroying them. It certainly did this with the warp engines. Using that same logic, it could have simply corrected the misunderstanding about Kirk, attributing it to damaged records beyond its control. One could say that Kirk's pressing upon Nomad's prime function to sterilize imperfection distracted it from taking a more constructive tact... but again, giving how sophisticated Nomad was... eh.
M5 misinterpreted a battle drill exercise as the real thing. When it was finally made aware that it was killing innocent people due to a flawed understanding, it decided to destroy itself... yet, it would do so by taking more innocent lives, which is illogical. The proper course of action would be a self induced short out (overloading some internal components), done after relinquishing control of the vessel. But then, Daystrom's mental engrams were imprinted upon the computer, so it did have some subjective issues.
Landru didn't need to self destruct. It was made aware that it was killing off "the body" slowly. It could simply have relinquished its control over the people and then serve as a reference data system for the citizens. Its control capabilities could have been curtailed back, but still used as a means to neutralize people in the act of committing a crime. Self destruction meant a significant loss of technology for the people. Spock himself indicated how sophisticated Landru was. Certainly when presented with how Landru's actions were not helping the body, it could have said "I have misinterpreted the original will of Landru. I will correct this flaw. Thank you, gentlemen." But then, it wouldn't have been as entertaining an ending... no Kirk hero moment.
