For crying out loud, the guy committed genocide. I just don't see any way to rationalize putting the guy back in command of a starship after something like that.
Wrong. Garth didn't commit Genocide, he attempted it but was stopped by his crew. (Watch Whom Gods Destroy starting at minute 18.)
He hasn't been put back in command of a starship, he was simply in Starfleet in "Going Boldly". Note the insignia he is wearing.
As to if he would be back in Starfleet after WGD:
1) He was in a terrible accident.
2) He was driven to madness because of the cellular metamorphosis that he was taught by the Antosians.
3) Even in 21st century America, "not guilty due to mental incapacity" is a mainstream legal principle.
4) It is clear that the inmates of the Elba II colony were the "last few criminally insane" in the Federation. Obviously, the medicine cured them as we start to see at the end of the episode. Mental illness has obviously not only been cured, but does not have the stigma it has in our day and age.
So not being at fault for his mental illness, and not being legally liable for his actions, and being fully cured, and (in our take) having no memory of anything that happened after the accident, Starfleet returning one of their most important captains to service is not unlikely in an enlightened universe that Roddenberry created.