This is moving away from the case in point, to a degree; but now that we've moved from a supernatural view of insanity (ie lunatics who were at the mercy of the cycles of the moon etc) to a more pragmatic one that focusses on agency and any danger to the 'patient' or others, does it really matter whether he is mad or bad, so long as he is kept somewhere where the risk to others is minimised?
If that means that a prison environment is unsuitable as he would pose a risk to staff and other inmates, and a hospital setup is more appropriate, then so be it; but the idea that it is unfair to punish people for actions beyond their control seems out of date now that there are so many diagnosable conditions that may limit impulse control and maybe agency too. It should come down to pragmatics, really.
The above is phrased as a statement, but is meant as more of a question, as I have zero expertise in this area beyond having watched a lot of courtroom drama on TV
.