Nearly 300 mentally retarded people are confined illegally in Maryland state mental institutions, where many of them have languished for more than a decade, a report by the state attorney general's office revealed today.

One mentally retarded man, currently held at Springfield Hospital Center, the state's largest mental institution, has been hospitalized since 1929, Attorney General Stephen Sachs said.

Under Maryland law, people suffering only from mental retardation cannot be confined against their will in a state institution for the mentally ill.

"To sit for 15 or 20 years in a corner of a ward of a state mental hospital without getting any treatment . . . is shameful." Sachs said in announcing the results of his office's four-month inquiry into practices of the Department of Health and Mental Hygiene.

At the same time, Sachs' inquiry found that some state institutions, because of inadequate admission hearings, were failing to detain some people whose mental illness made them a threat to themselves or society.

And a 1978 state study showed that nearly half of the approximately 2,000 patients confined for a one-year period could have been treated more appropriately in less restrictive facilities, such as nursing homes, according to Sachs' report.

Dr. Stanley Platman, assistant secretary for mental health and addictions, said he agreed with "everything" in the Sachs report, and was pleased that it already had brought a response from the governor.

Gov. Harry Hughes has indicated that he will support a department request for as much as $500,000 in added funds this year to turn a state hospital building into a facility for the mentally retarded.

At Springfield Hospital Center some of the retarded individuals were housed with the mentally ill in a building where the first floor consisted of a small, unused stereo room, a common bathroom and a large room furnished with little more than wooden benches, according to one of those who conducted the four-month inquiry. The second floor was filled with beds, arranged "military style" about three feet apart.

"There were people sitting, staring straight ahead, some were agitated and walking about, others were sleeping on benches or on the floor, some were talking, others walking around in a fenced-in yeard outside," the investigator said of the activity of the first floor.

No one was reading, and the stereo remained silent during his visit because there was no staff member available to see that it was used without being broken, the investigator recalled.

Platman said that since Maryland law decreed in 1972 that it was illegal to admit retarded individuals -- not suffering from any mental illness -- to mental hospitals, the department has been aware that it has 300 or 400 people "stuck in the wrong place at the wrong time." The department attempted to place them in special facilities for the retarded, but found the facilities not only overcrowded but already facing lawsuits for varieties of problems, the doctor said.

In 1977, a building at Crownsville Hospital Center in Anne Arundel County was renovated for the retarded, but the health department was unable to get extra funds to provide special programs for them, Platman said.

Now, more than 50 retarded individuals are confined there, "a pleasant place compared to many of our facilities . . . but still a mental hospital, that doesn't have what's required," according to Platman.

The other retarded people scattered in the state's institutions, Platman said, are getting "similar care, in worse surroundings with less hope."

In 1972, Maryland changed its laws and excluded retardation from the legal definition of mental disorder. It was the time legal and professional perceptions of retardation were changing.

Mental retardation is a "deficiency in intellectual functioning," and retarded persons need special education to gain some of the basic survival skills most people learn from parents and peers, Platman said.

Mental illness, however, can cause distorted thoughts and false perceptions of reality, and can become so severe that a person must be removed from a time from society, the doctor said.

The Sachs inquiry, prompted by allegations made by the Mental Health Association of Maryland, a citizens group, identified other problems in the state's mental health programs.

Nearly 500 elderly people, now confined to state hospitals, should really be in nursing homes. Placing them in nursing homes will cost more that $7 million a year, about the same cost as the current institutionalization.

Despite state laws requiring that community programs be devised for patients released from the hospitals, this often is not done. One major state hospital prepared these "aftercare" plans for less than 10 percent of the chronic patients it released.