I thought it was clear that Daystrom's suppressed rages were being vented by the M-5, as a consequence of scanning his own engrams into the computer. Daystrom was in the right? No, he needed a long, restful vacation [http://www.chakoteya.net/StarTrek/53.htm]:I had nothing but sympathy for Daystrom…one of the few times I felt at odds with Kirk. He was in the right…but I wonder why he didn’t just have Daystrom tell M-5 this was another drill.
KIRK: The M-5 must be destroyed.
DAYSTROM: Destroyed, Kirk? No. We're invincible. Look what we've done. Your mighty starships, Four toys to be crushed as we choose.
(Spock neck-pinches Daystrom.)
DAYSTROM: Destroyed, Kirk? No. We're invincible. Look what we've done. Your mighty starships, Four toys to be crushed as we choose.
(Spock neck-pinches Daystrom.)