People are complex. They do good things of their own free will. They do not good things of their own free will. They do good things in reaction to other events. They do not good things in reaction to other events. They even smoke ciggies to get around that pesky nicotine and/or oral fixation.
Did Daystrom kill hundreds of people? No. His machine did. His machine was a form of AI, in an episode that takes AI to a near-camp level to demonstrate the point of "human good, 'puter bad"- something numerous sitcoms in the 1960s and 1970s would also do. But back to Trek: His computer is a form of AI that clearly had a conscience, complete with engrams of his personality as an experiment that everyone thought had sufficient testing*. Daystrom can be acquitted by that alone.
* Remember, lab testing is never identical to real life experience. It's another reason I loathe that TNG story "Ethics" from season 5, which clinically overlooks so much and solely to tell a one-sided narrative to make Dr Crusher look right and pure in a loaded plot scenario. But before I digress, especially as this is not the TNG forum...
Let's discount that and look at it from another point of view: Daystrom was a pioneer who made things better for quite a few people. He refused to believe his AI creation would act in such a berserk manner, much less be overrode by him. People make mistakes, stuff happens. In a venue that is highly risky (outer space, which the episode reminds us many times - as do other episodes, hence speeches like "risk is our business" and so on.) Daystrom is acquitted via this venue as well. The fact he was horrified only showed how he had no ability to control the situation, the machine - either via consciousness or a form of logical response that was there that he didn't recognize - was making the decision of its own accord. Even Daystrom's team couldn't have fathomed such a possibility taking place.
It is also possible somebody may have sabotaged his work before it got to the Enterprise. That is another good reason for acquittal. The episode itself ignores these underlying details since it's a standalone 50 minute episode, but it's not inconceivable.
There are other possibilities, like work done after being released from the psychological rehab center, I can't mention all of them but one of these top three seems to be the most likely.
This might be a possible plot for a prequel (any whose acronym doesn't spell S.T.D., that is) or Kirk-era novel to flesh out. One of the few I'd take an interest in as there's enough room to maneuver with to expand the Daystrom story and legacy with.