"In a functioning democracy we don't detain people just because it's easier," the lawyer told the court.
"There are very specific statutory requirements before a young person can be put in secure care."
He added: "The right to liberty is about as big as it gets."
Oranga Tamariki lawyer Chris Lange said it was a "complex case".
Courts always tread carefully where child custody issues arise, he said, and all other accommodation options, including a motel, were not deemed suitable. No other care and protection facilities had available beds, Lange said.
Oranga Tamariki did not believe the youth was being held in secure care, as he enjoyed "much more flexibility" than those remanded there.
"The fact there are restrictions does not make it an unlawful detention," Lange said.
Lange believed that the Family Court was a more appropriate forum to deal with the case.
Justice Rachel Dunningham reserved her decision but realised it required some urgency and hoped to release it by the weekend.
It comes after a 14-year-old boy arrested in Christchurch for a petrol station hold-up was detained in a "barren and desolate" police cell for five days in a case that dismayed Youth Court Judge Jane McMeeken.
And in March, another Christchurch Youth Court judge ordered the immediate release of an 18-year-old held in solitary detention at Christchurch Police Station cells for seven days, claiming it breached the United Nations Convention on the Rights of the Child.