The bungalow doesn't look much like a children's home. A sheet of privacy film wrongly placed outside a window is peeling. Inside, the wallpaper is flaking, carpets are frayed and doors are broken. The children's home is unregistered and therefore illegal, but the provider is charging a council elsewhere in the country £13,000 a week to care for a vulnerable teenage girl. She requires the support of three full-time members of staff. There are no books, toys or games.

Just a few miles away, another illegal children's home is being run from a council house. Its tenant is subletting the property to a company that is also charging a different local authority thousands of pounds a week. Five years ago, reports into such placements led directly to a government ban on the use of unregulated children's homes in England. The investigation found that children as young as 11 were being housed in homes that were not registered with or inspected by Ofsted. These included squalid flats, tents, caravans, narrowboats and a home under surveillance by the police for suspected gang activity. It also exposed how one girl was trafficked directly from her home and sexually abused, while a boy was kidnapped from another home to sell drugs.

The 2021 ban on under-16s being housed in such homes was meant to bring an end to the practice. But in reality, councils struggling to accommodate children are placing more of them than ever in what are now illegal homes - at huge taxpayer expense. Unregistered placements are now costing as much as £2 million per child a year. The sector is a "Wild West," according to Dr Mark Kerr, chief executive of the Children's Homes Association. "This is the culmination of 10 years of systemic failure to develop specialist provision for our most vulnerable children," he says.

While the majority of children are either fostered, adopted or placed in legal children's homes, local authorities have struggled to find homes for children with the most complex needs - who are often the most expensive to care for. In around 800 cases in England, councils have turned to unregistered homes, despite the ban on them, according to the Public Accounts Committee. Counter-intuitively, just as the use of illegal children's homes has increased, the number of registered children's homes has soared - doubling from 2,209 to 4,455 in eight years, according to Ofsted. That's despite the fact that there has only been a 9% increase in the number of children in care over this period. Many sources say this huge increase in homes has been caused by a rush of new providers entering the market, alongside private equity and property investors. And even though many providers have no prior experience in care, prices have also surged. The amount spent by councils in England on children's residential homes has doubled in the last four years and tripled in the last eight years. Four years ago, some companies were making profits of 40%. Staffordshire council paid £2.6 million last year to care for a teenage girl in a registered placement who required up to five staff to care for her. Even the average placement in a registered home now costs £6,100 a week, or £318,000 a year.

But it's the unregistered homes - which are so brazenly run that Ofsted even records a tally of them - that cause the most concern. One whistleblower described seeing a boy living in a house where the sofa was propped up with two bricks; another said she had seen a child barricaded inside a room. Chereece, a care leaver, says she was moved between holiday homes in Wales for months - sometimes twice in a week. "It was an absolute nightmare," she says. "Different staff, different young people - I felt like I was a prisoner." Many of the children in illegal homes are located in terraced or suburban housing in parts of northern England with cheaper rents. One in five of all children in care are living at least 20 miles away from where they grew up, according to Clare Bracey of the national charity Become, which campaigns to end the practice. And even illegal placements can be hugely expensive. Multiple illegal homes are being paid over £2 million per child per year in extreme cases. These rising costs mean there is less funding for earlier support that may prevent children being placed in care, according to the Local Government Association.

So why would councils actively break the law? It's clear that the registered children's home market is not meeting the demands of a specific cohort of children with complex needs. This group - roughly 10% of those considered to require residential care - are sometimes violent and often require restraint. Some must even be locked up under Deprivation of Liberty orders mandated by the High Court for their own welfare. Previously, many of these children might have been placed in secure children's units, where they are locked inside, but places in these are very limited and can be very expensive. Cornwall has recently been paying £63,000 a week to place a child in such a setting. So councils say they are forced to turn to illegal children's homes. It's a situation akin to removing the "sickest patients" from hospitals and placing them in backstreet clinics, according to Anders Bach-Mortensen, an associate professor of social care at Roskilde University.

With a massive increase in the supply of children's homes, it might be expected that costs would fall. But the opposite has happened. Some directors of registered children's homes believe profiteering is responsible and cite an increase in property investors entering the sector. The current exodus of landlords from the rental market led some to look to convert properties to children's homes. A whole cottage industry has developed online to advise landlords how to flip rental properties. "Children's homes continue to offer a compelling alternative to traditional buy-to-lets," argues one middleman who markets his ability to secure the required planning permission on Instagram. On Facebook groups for managers and directors of children's homes, many openly admit to running illegal placements.

Some providers say Ofsted should share the blame. Its registration process is "broken" and encouraging illegal children's homes to "thrive," according to one director of a provider of registered homes. The influx in applications to register children's homes has led to waiting times of up to 18 months before the regulator takes a decision. As a result, some homes feel forced to open illegally or face financial ruin from rents and other start-up costs. But why can't registered children's homes accept this cohort of around 800 children? Directors say these residents - who may have histories of abuse, exploitation and mental health problems - sometimes smash up premises, attack staff and regularly go missing. Managers say even if they agreed to take these placements for fees of £30,000-£40,000 a week, it would not be worth the risk. Much of their reasoning is down to the long shadow cast over the sector by the appalling failure to safeguard 106 children in children's homes in Doncaster run by the provider Hesley. That investigation found children with learning disabilities were punched, hit with a dog lead and left outside overnight in winter, in what a national expert panel called "systemic and sustained abuse." Ofsted was notified of concerns on over 100 occasions before the homes were finally closed in 2021.

Providers say the regulator is now overly responsive to safeguarding alerts, which then trigger inspections. "After Hesley, Ofsted came out really defensive: if they suddenly saw a home with lots of notifications, it would trigger an inspection. So providers started sitting back going: 'Oh, I don't want to take that child,'" says Dr Kerr. When the ban on illegal children's homes was introduced, the Conservative Education Secretary said "the BBC had highlighted something that just needed to be changed." "That isn't something that we are going to allow to continue," said Gavin Williamson MP in 2020. "I think anyone with compassion in their heart realises it's not right."

But Ofsted has failed to successfully prosecute a single provider of illegal children's homes. The regulator told the BBC there were ongoing proceedings against some providers - and newly passed powers will allow it to issue unlimited fines to illegal children's homes. It added that it prioritises registrations for placements where children need to be accommodated urgently and is "very concerned" about the profit motives of some providers. No more stringent regulation has been introduced to hold the directors of these services personally accountable - in contrast to sectors like financial services, where bank directors can be held criminally liable by the Financial Conduct Authority. Some unregistered providers have begun billing local authorities separately for accommodation and staffing via different companies, in an effort to mask the fact that they are running a children's home. Ofsted said it was not aware of this but said constructing a different invoice would not change the illegality of the provision.

Children's homes were once largely owned and run by local authorities, but appalling abuse scandals from the 1990s onwards contributed to councils and charities retreating from the sector. At the same time, a drive to bring in new providers under New Labour saw councils in England and Wales increasingly commission children's social care, rather than provide it directly. This was underscored by David Cameron's call to "release the grip of state control" on public services. Now 84% of children's homes in England are privately run - compared with 17% in Denmark. Successive governments have failed to "get a grip" on the persistent shortage of appropriate placements for these children, according to Dr Kerr. "It's always somebody else's fault: it's either the local authorities' fault or the scandalous profiteering residential sector; nobody will seem to accept responsibility," he says.