Marvin Joseph/The Washington Post/Getty Images Maryland Correctional Institution, Jessup, Maryland

Pharmaceutical companies have recently paid out the largest legal settlements in U.S. history — including the largest criminal fines ever imposed on corporations — for illegally marketing antipsychotic drugs. The payouts totaled more than $5 billion. But the worst costs of the drugs are being borne by the most vulnerable patients: children and teens in psychiatric hospitals, foster care and juvenile prisons, as well as elderly people in nursing homes. They are medicated for conditions for which the drugs haven’t been proven safe or effective — in some cases, with death as a known possible outcome.

The benefit for drug companies is cold profit. Antipsychotics bring in some $14 billion a year. So-called “atypical” or “second-generation” antipsychotics like Geodon, Zyprexa, Seroquel, Abilify and Risperdal rake in more money than any other class of medication on the market and, dollar for dollar, they are the biggest selling drugs in America. Although these medications are primarily approved to treat schizophrenia and bipolar disorder, which combined affect 3% of the population, in 2010 there were 56 million prescriptions filled for atypical antipsychotics.

In a presentation this week at an American Psychiatric Association meeting, Dr. John Goethe, director of the Burlingame Center for Psychiatric Research in Connecticut, reported that over the last 10 years, more than half of all children aged 5 to 12 in psychiatric hospitals were prescribed antipsychotics — and 95% of these prescriptions were for second-generation antipsychotics.

Many of these children didn’t have a condition for which the drugs have been shown to be helpful: 44% of youngsters with post-traumatic stress disorder (PTSD) and 45% of children with attention deficit hyperactivity disorder (ADHD) were treated with them.

(More on TIME.com: SPECIAL: Kids and Mental Health)

Pharmacologically, the ADHD prescriptions make no sense: FDA-approved drugs for the condition raise levels of the neurotransmitter dopamine, while antipsychotics do the opposite, lowering them.

Goethe also noted another study that showed that the number of office visits by children and teens that included antipsychotic drug prescriptions rose 600% from 1993 to 2002. “The obvious second-generation bias is very apparent in these data, as is the irrational use of antipsychotics for indications such as PTSD and ADHD for which there is no controlled evidence whatsoever that these are safe or effective treatments,” says Dr. Bruce Perry, senior fellow at the ChildTrauma Academy in Houston. (Full disclosure: Dr. Perry is my co-author on two books.)

The situation is similar in state-run juvenile detention systems. Late last week, an exposé by the Palm Beach Post revealed that antipsychotics were among the top drugs purchased by the Florida Department of Juvenile Justice (DJJ), and were largely used in kids for reasons that were not approved by the government — for instance, sleeplessness or anxiety. The Post reported:

In 2007, for example, DJJ bought more than twice as much Seroquel as ibuprofen. Overall, in 24 months, the department bought 326,081 tablets of Seroquel, Abilify, Risperdal and other antipsychotic drugs for use in state-operated jails and homes for children. That’s enough to hand out 446 pills a day, seven days a week, for two years in a row, to kids in jails and programs that can hold no more than 2,300 boys and girls on a given day.

Among the psychiatrists hired by the state to evaluated incarcerated kids, about a third received drug company money, the Post reported. Those 17 psychiatrists wrote 54% of the prescriptions for antipsychotics; the 35 doctors who did not take such payments wrote the rest. In other words, one-third of doctors — all of whom were paid by drug companies — wrote more than half of all antipsychotic prescriptions for the state’s locked-down youth.

(More on TIME.com: Perspective: Why Comparing Painkiller Addiction to Crack Worsens the Problem)

The statistics on children in foster care are equally alarming. Youth in foster care are not only three times as likely to be medicated as comparable low-income youth on Medicaid, but more than half are treated with antipsychotics. It is not likely that all or even most of these children have a condition for which antipsychotics have been approved by the government to treat.

Among the problems with unnecessary use of antipsychotic medications is that they can cause serious, sometimes irreversible, damage. Atypical antipsychotics are associated with weight gain and may double users’ risk of Type 2 diabetes. Recent research also suggests that they may shrink the brain and there is little data on how they affect brain development during the teen years, when the brain grows more than at any other time but infancy. Indeed, youth are more vulnerable than any other group to the drugs’ worst side effects (with the possible exclusion of death).

(More on TIME.com: Why Has Childhood Bipolar Disorder Become an Epidemic?)

“The majority of antipsychotic medication use in children and adolescents has not been limited to the few age groups or conditions for which there is credible evidence of efficacy and safety,” says Perry. “There is no reason to expect irrational prescribers to change their bad habits.”

He adds that many experts would argue that if doctors began prescribing antipsychotics “responsibly and cautiously” — that is, being mindful of the lack of efficacy data and the evidence of harm — the rate of prescriptions in children would drop by 90%.

Meanwhile, prescribing at the other end of the lifespan is also out of control. In nursing homes, 14% of residents have been given at least one prescription for a second-generation antipsychotic, according to a government investigation. A full 88% of these prescriptions are given to people with dementia, despite the fact that these drugs may double the risk of death in these patients (there is a black box warning on the drug to this effect). The investigation estimated that $116 million Medicare dollars have been spent filling antipsychotic prescriptions that never should have been written.

So why are these drugs so widely prescribed? Aggressive drug company marketing is only one part of the story. A key reason they are overused in institutional settings is that they are sedating, making patients easier to manage. Secondly, unlike other sedative drugs, they are not associated with misuse (except perhaps Seroquel, which has fans among some addicts). In fact, most people resist taking antipsychotics, which is why overmedication is much more common in settings where people are locked-in and compliance can be forced.

(More on TIME.com: Top Ten Legal Drugs Linked to Violence)

The fact that the drugs are not associated with addiction is another big part of why drug companies have been able to get away with so much misleading marketing and the resultant overprescribing. Unlike traditional sedatives like benzodiazepines (Valium or Xanax), which are controlled substances, few people enjoy misusing antipsychotics. With side effects like weight gain, pleasurelessness, movement disorders, and low energy and motivation, there’s not much of a recreational market.

Consequently, they can be prescribed for unapproved uses like behavior control and sleep-inducement in children and the elderly, without government scrutiny or fear of prosecution for “overprescribing.”

In other words, addiction is basically seen as a worse side effect than, say, death (or any other outcome such as Type 2 diabetes or the complete inability to feel pleasure). The fact that the most vulnerable youth and elderly often cannot advocate for themselves has made it easier to sweep the problem under the rug.

(More on TIME.com: U.S. Aims to Reduce Overdose Deaths, But Will the New Plan Work?)

Fortunately, there is at least one bright spot in this depressing picture. The main patent on Risperdal expired in 2007, and those for Zyprexa and Seroquel expire this year. Geodon’s patent expires next year, while Abilify’s comes up in 2015. When most drugs go off-patent, drug companies’ marketing pressure — and profits — will subside, perhaps keeping children and the elderly safer from inappropriate medication.