A High Court judge said it was "difficult to understand" why Phillip Simelane was living on the streets in the months before he attacked Christina Edkins, despite concern about his mental state.
Christina died within minutes after being stabbed in the chest by Simelane in a "chilling" attack as she travelled to school on a bus in Birmingham.
Simelane, 23, who admitted manslaughter on the grounds of diminished responsibility, from Walsall, had been sleeping on the bus prior to the stabbing.
Ordering his indefinite detention in a secure psychiatric unit, Mrs Justice Thirlwall expressed concern the paranoid schizophrenic was not receiving treatment at the time of the killing.
The judge told African-born Simelane: "At the time you attacked Christina you were suffering from a serious mental illness... That is why you killed Christina."
The court heard an experienced specialist registrar in psychiatry had insisted Simelane needed in-patient treatment on at least two occasions prior to the killing. But no such treatment was made available.