How long do you think he should be kept away from society?
His actions don't justify a life sentence or the death penalty, so he's going to be part of society at some point.
Is taking him out of society going to make him a better person? No.
The best way to rehabilitate someone is for them to have something to lose.
If this 17yo had a wife/child of his own then it is far less likely that he would have done this harassment.
I had a childhood friend who got in with a bad crowd in high school. At some point, when he was about 17, he was caught illegally entering a business at night. His parents refused to go pick him up from the police station, so he had to spend the night and most of the next day in a cell. I don't believe his ultimate punishment involved any jail time.
I respect his parent's decision. That sort of action teaches a troublesome kid that there are real consequences for breaking laws beyond just upset parents. While a criminal record might make it harder for him to get a job in the future, it certainly doesn't make it impossible. I also suspect it is better than letting a kid think that other people will protect him and he can get away with whatever he wants.
If the premise here is that this man-child is too immature to take on the responsibilities of adult society (such as the right to own firearms, the right to drive automobiles, the right to drink alcohol, etc.), that he is in some way developmentally disabled, then should he not be kept away from society and denied the ability to hurt others?
You are setting up a false dichotomy here. You are saying that the choice is either that this person be sheltered by a nurturing and loving community who protects him from the consequences of his actions and if not then his life will be ruined utterly. He needs to face the consequences of his actions. He needs to learn that it is necessary to abide by just laws in order to live in society and to fail to do so will result in very serious consequences. If he cannot accept any responsibility then he has no place in civil society.
What are the possible consequences of someone being sheltered from the consequences of their vile, hateful, violent acts? That person can become mentally and emotionally twisted and their hatred and lust for wanton destruction can grow. And this can occur even within the sheltering arms of a loving community. And then the hurt they cause others and the irreparable damage they do to themselves becomes even greater until they become a monster. A rapist, a serial killer, or merely an outcast who cannot mesh with society.
This is not about moral high towers, this is about ensuring that society does not become burdened with so-called adults who have never faced true responsibility and are incapable of functioning properly within society.