Say we agree he's a terrorist, what practical difference does it make?
He's a fruitloop, either way. The question is, how do you control random fruitloops? There seems to be no claim that he's insane, in a legal sense. If that's right, he could not have been sectioned, as you can't section people judged to be sane.
In my book, he's as mad as a hatter, but I'm neither a medical nor legal professional, so my opinion is as nothing.
You can't preemptively lock up people for being weird, or half of us would be in Strangeways. And only his being locked up would have forestalled this tragedy.