WHEN CHILDREN are wild, that does not mean they are crazy - but thousands of children are locked away in mental institutions anyway. With scarcely any legal rights, their lives may ve ruined by damaging drugs, brutal incarceration, even brain surgery.

Last week the Surpreme Court rejected a mauor challenge to the power of parents and psychiatrists to dump such children into insitutions. But lawyers for the American Civil Liberties Union, the Children's Defense Fund and other groups say that the fight is far from over, that legal warfare will continue, especially over post-commitment challenges to children's continuing institutionalization. And with good reason.

The Supreme Court, in denying children the right to a legal hearing before they can be committed, declared in effect that parents should be free to do whatever they want with their children; this leaves parents free to "doctor shop" for a psychiatrist willing to commit their child. It also held that a psychiatrist, who may well be an advocate of commitment, can be considered a "enutral" fact-finder in such cases.

But evidence from around the country shatters one's confidence in the court's defense of parents' rights and psychiatrists' powers.

In Mississippi, for example, a 9-year-old boy was labeled "agressive" and "hyperactive" by a psychiatrist who is an enthusiast for lobotomies - now more delicately termed psychosurgery. Over a lengthy period, half a dozen operations were performed, destroying different parts of the child's brain in an effort to alter his behavior.

The boy's intellectual capacity suffered massive and irreversible damage; his emotions and personality were permanently blunted. But after the shock of each operation wore off, the wild, angry behavior returned;. No court intervened to stop the destruction; no approval was required beyond that of the parents.

In Pennsylvania, a 12-year-old boy with no father was alternately abused and neglected by an alcoholic mother who had been in and out of mental institutions for years. He constantly ran away from home, got into fights and had screaming matches with teachers at school.Social workers, rather than putting him in a foster home or in a juvenile institution as a status offender, had him committed to a state mental hospital. He never saw a lawyer or a courtroom, as he would have if he had been charged as a delinquent.

The psychiatrist, who saw him for barely 10 minutes on admission, diagnosed him as suffering from "anxiety," "hostility" and "aggression" - the evidence consisting of his hysterical pleadings not to be locked away in "the crazy house;" To control these symptons of "mental illness," the boy was given heavy doses of Thorazine, a powerful, mind-altering tranquilizer known to have permanently damaging side-effects with long-term use. He was left sitting glassy-eyed in the middle of a ward, barely able to function mentally or physically. Neither his mother nor t e social agency ever reclaimed him; the commitment was for an indefinite period.

In Arizona, a 15-year-old girl was trying to escape from a family locked in a permanent state of internal war. A straight-A student bored with school, she cut classes to run around with counterculture friends and quarreled angrily with her cold father and hysterical mother. In an attempt to scare them, she looked up how much aspriin it takes to kill you - and took just enough to make herself sick. Her frightened parents dragged her away to an expensive private mental institution.

There the psychiatrist asked no questions about what the parents may have been doing to their daughter emotionally, simply taking their word that she has been "acting crazy" and has attempted suicide. For six months she was given massive electric shocks to the brain, which destroyed part of her memory, irreversibly damaged her IQ, and kept her in an almost constant state of mental confusion - a pallid, greenish-hued figure who could only whisper, over and over to visitors, "Get me out of here; please, get me out of here."

Friends and relatives sought a lawyer, who told them that nothing could be done; she had no right to a court hearing, no right to a lawyer, no legal rights at all.

Although the dumping of children into mental institutions has been in the headlines in recent years, most states still do little or nothing to limit the power of parents, social service agencies and psychiatrists to commit children, often for indefinite periods, or to give them medical "treatments" with irreversible effects on the brain.

The rulings the Supreme Court overturned last week were in cases from Georgia and Pennsylvania, the latter having been kicked up and down the appeals ladder for almost seven years. Even if the Pennsylvania ruling had been upheld, though, it would have come too late to help most of the children in whose name the case was brought.

David Ferleger, who argued the case for the Mental Patients Civil Liberties Project, says that "the kids in the original complaint are all adults now; most are no longer inside. " One girl, then 13, is now a mother with a child of her own.

But they've been replaced by other children. Neither the National Institute of Mental Health nor the American Psychiatric Association has reliable figures on how many children and adolescents are committed to mental institutions. What is known is that, while the total mental instituion poupulation has fallen sharply in the past 25 years (as powerful tranquilizers have replaced canvas straitjackets), the numbers of children and adolescents have risen significantly as a proportion of the remaining total.

The landmark case In re Gault (1977) established the right of due process in the juvenile courts. Many of the children in the original Pennyslvania suit had been committed not because of alleged delusions or hallucinations, but for running away from home, cutting school, being beyond parental control, and other wild behavior identical to that of children brought before the juvenile courts as status offenders. Other juvenile court cases have introduced the idea that the parents, not the child, might be to blame for the child's behavior.

But both the state public welfare department and the psychiatric establishment have strongly opposed any extension of such due process rights to psychiatric commitment cases - or any suggestion that the parents, rather than the child, might be held responsible for family conflict.

The public welfare officials complained of the "large sums of money which will be necessary to provide the thosuands of hearings with appointed counsel" at which the child could confront his accusers. The psychiatrusts denounced the proposed hearings on the ground that the hearings - rather than the parents' attempt to put the child away - would cause psychological harm to the child and provoke emotional conflict and trauma within the family.

The APA, in what it considered a major concession, agreed to the idea of hearings for children - after 45 days of commitment and treatment. But by that point, critics charge, the damage has been done - not only in terms of the use of treatments with irreversibly damaging side-effects, but also in terms of the disastrous life-long stigma attached to psychiatric commitment.

In New York, for example, a girl of 15 with a mother who didn't want her was committed to a mental institution by social workers after fights with teachers at school. The institution decided she should never have been brought there and tried to hand her back to the socil welfare agencies. Two years later she was still in a psychiatric ward - once committed to a mental institution, no community-based children's home would touch her.

In California, a young woman regularly perjures herself by signing state job applications and government documents on which she answers "no" to the question of whether she has ever been a mental patient. Commited by her parents as a teenager after a series of family fights, she lives in fear that one day that record will catch up with her. Former mental patients have less success in getting jobs than ex-convicts.

In the Pennsylvania suit, the district court found that the damage done to a child for the rest of his or her life by the stigma of psychiatric commitment, together with the "substantial potential for conflict between the interests of the parent and the child," justified the demand for due process rights for children. It was this argument which the Supreme Court rejected. But even if the Supreme Court had upheld this ruling, the establishment of hearing procedures also would not necessarily have barred, or even seriously restricted, the commitment of children to institutions.

The looseness of psychiatric definitions of "mental illness" remains unchallenged in the courts. As critics have noted, despite regular reports in the medical press that the psychiatric profession is on the verge of scientific breakthroughs that will locate chemical causes - and chemical solutions - for what appear to be strictly emotional problems, diagnoses of "mental illness" in children and adolescents are in practice based solely on their emotional state and behavior - behavior that is causing trouble for parents or teachers.

Moreover, courts in adult commitment hearings have traditionally been highly deferential to psychiatrists' "expert testimony," even though one survey of courtroom practice showed that this testimony was usually based on hearsay, anonymous hospital records, and a brief interview with the patient. Finally, no legal moves have been made to bar the use on children and adolescents of such treatments as lobotomy, electric shock or powerful drugs that cause irreversible brain damage - although the courts have indicated great unhappiness with using such treatments on involuntary patients.

Some parents unquestionably would be deterred from seeking commitment for a child if they see the prospect of washing the family's dirty linen in court, under cross-examination by their child's attorney. This prospect prompted the psychiatrists' last-ditch argument: "What do you do with the kid if he wins?" The family relationship has been destroyed, yet community children's homes are notoriously inadequate, and foster care has itself become a national scandal.

Lawyers for the children reply that that's the state's problem. Only if it is made extremely difficult to put children away in mental institutions, they argue, will states be forced to spend the money needed to establish decent community homes for emotionally disturbed children whose own families have irretrievably broken down. CAPTION: Illustration, no caption