Apparently it's due to a 'toleration permit', some sort of legal loophole in German law that means a failed asylum seeker can effectively dodge deportation.
https://www.independent.co.uk/news/...ck-suspect-farhad-asylum-seeker-b2697789.html
We live in a crazy world.
Who is the suspect?
Farhad N, born in Kabul in 2001, first arrived in Germany from Afghanistan at the end of 2016, according to Der Spiegel.
He is reported to have had his asylum application rejected by the Federal Office for Migration and Refugees.
Bavaria's Interior Minister Joachim Herrmann confirmed that he had arrived in the country as an asylum seeker adding that his application had “probably” been rejected, Die Zeit reported. But Mr Herrman added that the suspect “cannot be deported at the moment and that he was therefore allowed to continue to stay in our country”.
He had been granted a toleration permit which means that deportation is suspended, Der Spiegel said.
He was already known to police
"So far we know that he has been caught with drugs and shoplifting, but according to the current state of the investigation, no violence has been detected,” a police spokesperson said.
Investigators are continuing to look into his background as they try and establish any potential motive.
German chancellor Olaf Scholz has called on the perpetrator of the attack to leave the country.
"This perpetrator cannot hope for any leniency. He must be punished and he must leave the country," Mr Scholz said.
"If it was an attack, we must take consistent action against possible perpetrators with all means of justice," he added.