It can cost as much as £600 a day to keep a young offender in a secure unit designed for children. Most youth justice resources are concentrated on the incarceration stage but, when released, children – often returning to neglectful, chaotic or addicted families – frequently revert to old behaviours because of a lack of support.

Robbie is one of these children. By age 12 he was addicted to heroin and his crimes to support his habit were legion. What better recipient for the disgust and hatred aimed at "our feral youth" than Robbie? Now 16, his crimes have landed him more than once in secure units as well as a hostel for adult offenders. His incarceration offered the perfect opportunity to get him drugs-free. What better place for freeing children from addiction? Safe, well staffed and highly resourced, secure units could do the job for kids that residential rehabilitation does for adults.

Except they don't. A skills' deficit when it comes to understanding drugs, plus bureaucracy and an opaque legal system mean that, despite the fact that Robbie has begged for detox, units feel more comfortable managing children's addictions instead of treating them. Management, whatever your age, usually means one thing: methadone. This synthetic opioid is widely prescribed to keep addictions legal and drug crime under control. The problem for methadone users is that they are still drug addicts and, far from dealing with dependency, methadone fosters it.

Robbie may be a kid but, like all serious addicts, to leave heroin behind he needs intensive residential treatment, starting with detox and then moving on to the various stages of rehabilitation. Addicts need long-term counselling from specialists, help with learning to live a normal life and the love and support of other recovering addicts. Unfortunately, this treatment is not available to anyone under 18. The secure units cost a lot but they can only hold the children – they can't help them deal with their drug problems or support them on release. There was one treatment centre for children in the UK. It closed last year.

Robbie doesn't come from a part of the UK where there are even adult residential treatment centres for addictions, so last week I took him and his social worker around the south coast, where there are lots. He was amazed to meet professionals and addicts who understood his problems. He learned that rehabilitation is a tough option that forces the user to confront the pain that heroin has been helping him ignore. Nevertheless, he asked, with a sense of urgency, for a place in treatment. But the answer is always the same: it is illegal for adult services to treat a child.

After a remarkable display of resilience and shape-shifting in the face of bureaucracy, one centre is hoping to find Robbie a compromise programme that might not break the law. He knows that without it he will at age 18 still be drugs dependent, in jail or dead. Let's hope the financial buck-passing ends happily for him. But what about the small but significant number of other drug-addicted kids who cost society so much?

Robbie was brought up by adults in an addicted household, he learned his addiction and criminality from adults, adults sold him drugs, he was incarcerated by adults and was sent to a hostel where he was surrounded by drug-using adults. Yet he is being denied adult treatment for his adult problem. Instead, he is given methadone like candy. Our feral youth? We made him that way and seem determined to keep him that way.

• Mark Johnson, a rehabilitated offender and former drug user, is an author and the founder of the charity User Voice.