The Maryland Medical Society, which had been expected to endorse a proposal to allow use of heroin to ease pain in terminally ill people, instead strongly voted yesterday against the measure on grounds that not enough scientific data is available.

The society's 150-member House of Delegates defeated by a 2-to-1 vote a resolution calling for legalized use of heroin in treatment of "intractable pain" in dying patients.

"I think most of us were prepared to vote for the resolution when we arrived here today," said Dr. Francis C. Mayle, new president of the state medical society and a physician in Montgomery County.

"Most of us were unaware until today that in the last six months research has started to compare heroin with other drugs. We want to wait for the conclusions of that research."

He was referring to a $1.5 million research project at the Memorial Sloan-Kettering Cancer Center in New York. The project is one result of a policy set by the Carter administration last year, in whiich doctors were encouraged to conduct research on such drugs as heroin and marijuana to determine their value for "therapeutic purposes."

Another heroin research pfoject is just beginning at the National Institutes of Health in Bethesda.

A central figure in the debate over heroin's merits in treatment of pain has been Dr.Robert G.Twycross, a physician at a hospice in England who has treated hundreds of terminally ill cancer patients with heroin.

"The first reports I read about Dr. Twycross' research in which he used heroin to treat some patients and morphine to treat others was that heroin had definite benefits," Mayle said.

"A later article (published in late 1877 in the journal Pain) indcates that heroin may not be superior to morphine after all," he continued.

"There is a great deal of evidence to show that drugs that we now use to control pain are as good as heroin would be," said Dr. Arthur T. Keefe, who served as president of the state medical society last year. "My question is, "Why bring heroin back into legalized use unless it's really going to help people?'".

Mayle said he received a telephone call early yesterday morning from Dr. Seymour Perry, associate director of the National Institutes of Health. "He said he wanted us (the state medical society) to not be hasty in our decision about heroin; that more research is needed," Mayle said.

Perry said a committee of 12 agencies and institutions was created last year to begin tests of heroin in treatment of pain and marijuana in treatment of glaucoma and nausea.

The controversy over use of heroin in care of the dying comes at a time when the hospice movements is enjoying wide support in communities around the country. There are more than 100 hospice groups in the United States, according to the Washington Hospice Society.

A hospice, which in medieval times was a "way station" for travelers, is defined today as a place that provides shelter and care for the dying, offering pleasant surroundings and freedom from pain through use of pain-killing drugs.