For Gods sake, this kid needs psycho help/treatment, not years of jailtime. Don`t destroy a young human life for a stupid stunt that did not endanger anyone.
He was non-violent, had nothing suspicuous in his baggage, probably only some twisted fantasy in his mind.
If procedures were right, cockpit door was locked anyway, so there was zero chance he could interfere with the flight crew. It would be different story if he succeeded getting in cockpit and/or became violent.