Barrister Ruth Brander, for the 17-year-old who cannot be named for legal reasons, said West Sussex CC have not done enough to ensure she has somewhere stable to live.
But, on 3 May, she was released on a three-year community rehabilitation order and housed by the council at a hostel in Crawley.
Ms Brander told High Court judge, Mr Justice Calvert-Smith, that the 'vulnerable' teenager was not safe at the hostel because of other residents, many of whom are men with long criminal records and drug and alcohol problems.
Launching a judicial review challenge against the council's decision to offer the hostel as accommodation, Ms Brander also said social workers had failed to plan properly for her release from custody.
The barrister added that, from December, the council were 'on notice' that the girl might get a non-custodial sentence and should have done more to ensure she had a safer roof over her head.
Mr Justice Calvert Smith heard the girl had endured a troubled childhood, and her parents had split up when she was 13.
She lived with her mother but was 'abandoned' by her when she was 15 and eventually ended up on the streets, where she was drinking up to two litres of vodka and taking 24 ecstasy tablets a day.
Ms Brander added the 17-year-old had a long criminal record herself, but had committed crimes as a cry for help.
While behind bars she had taken steps to address her alcohol and drug problems and begun educational courses, said the barrister, but fears she will go back to her old ways if she remains in the hostel.
After listening to an afternoon of legal arguments, Mr Justice Calvert Smith adjourned the case to allow the council more time to prepare reports on the girl and make suitable offers of accommodation.
Lawyers for the local authority had assured the judge that a decision on the future of the girl would be made by 1 June.
STRAND NEWS SERVICE