The part aside where the permit was probably issued by an agency and not a judge: what, prior to this incident, was wrong with somebody like him being in Germany?
He came over as a teenager, alone, from a war-torn country. He did his school, did his vocational training and worked in a job where he was actually helping to catch criminals. He had no criminal record himself and was, according to recent statements, well integrated. He had no known tendencies towards extremism, had not made any threats as far as anybody knew. Why would he not be welcomed and get a permission to stay? What kind of sick sociopath would want to send somebody like him, who seemed to be a success story of an immigrant, back to that shitehole that is the current Afghanistan? For what one even want that? Because his skin had the "wrong" colour or he called his god the "wrong" name? Because the country is "full"?
The only two offenses to his name known to date is that, one, his original asylum application was rejected because they thought the story behind it - him being persecuted by a criminal organisation which had already killed his father - was a lie, and the second one that he was once registered jobless for a short while, took up a job again and did not report it quickly enough to the agency, which landed him a fine for the reportedly "very short time" that covered. The first one I empathize with because if I wanted to escape Afghanistan I'd lie my arse off about why I should be allowed asylum, too. And the second one I find utterly negligible since he seemingly reported it, just not quite quickly enough, so I don't think there was any malice or intent to deceive there.