The House yesterday overwhelmingly approved legislation that for the first time would allow members of the armed forces to sue the federal government for medical care received in military hospitals.

The bill, approved by a vote of 317 to 90, was sparked by horror stories about questionable medical care in military facilities and recent government audits revealing serious inadequacies in many military hospitals.

The legislation now goes to the Republican-led Senate, where supporters said it faces an uncertain future. The Pentagon and the Reagan administration strongly oppose the bill, contending, in part, that suits by active-duty military personnel could undermine military discipline and unduly involve civil courts in a review of military command decisions.

In the Democratic-controlled House, these arguments carried little sway with either party yesterday, as Republicans joined forces with Democrats to back the measure.

The legislation, sponsored by Rep. Barney Frank (D-Mass.) and a bipartisan group of 83 other lawmakers, would overturn part of a 1950 Supreme Court ruling that barred active-duty military personnel, unlike others, from suing the federal government for medical malpractice.

Lawmakers said yesterday that the Supreme Court decision, which is known as the Feres doctrine, unfairly and unnecessarily discrimi- nated against those in the armed services. Under current law, spouses and children of those in the military can sue on treatment they receive, while military personnel cannot.

"This bill says the people who are on call 24 hours a day to protect our rights and liberties will now have the same rights as their children and dependents have," said Rep. Patricia Schroeder (D-Colo.).

Frank said yesterday his bill does not permit military personnel to sue for treatment received in combat situations, allowing them to sue only if injury or death occurred because of regular treatment in medical facilities operated by the armed forces or the federal government.

"I don't think that's a radical step," Frank said. "No one's going to be suing Hawkeye under this bill," said Frank, alluding to Hawkeye Pierce, the Korean War Army field surgeon featured in the television show "MASH."

Rep. J. Roy Rowland (D-Ga.), one of the few physicians serving in the House, was also one of the few to speak against the measure yesterday, arguing that it would result in thousands of new medical malpractice cases being added to "an already overburdened civil court system."

In addition, he said, the bill does nothing to solve the problems of military medicine or attract good new medical professionals to the armed services. According to the Congressional Budget Office, the legislation would cost the federal government about $25 million a year.