A federal judge in Alexandria yesterday upheld the state of Virginia's decision to discontinue Medicaid payments for abortions unless a physician determines that the life of the mother is in danger.

U.S. District Court Judge Oren R. Lewis cited a June 1977 decision by the U.S. Supreme Court that the states could decide whether they would reimburse indigent women for nontherapeutic abortions. "This court will not require Virginia to do what the Supreme Court has said it does not have to do," Lewis said.

Lewis also ended a temporary injunction issued April 21 that ordered the state of Virginia to resume Medicaid payments for "necessary therapeutic abortions" for indigent women pending yesterday's ruling. The state had stopped financing the Medicaid abortions on April 1.

Assistant State Attorney General Robert A. Adams said yesterday in Richmond that such payments would probably continue until next week because it would take that long to notify doctors formally of yesterday's court decision.

Lynn Mille, one of the attorneys who represented the plaintiff, said yesterday the decision will be appealed to the 4th U.S. Circuit Court of Appeals. Miller said she also would try to obtain an injunction prohibiting Judge Lewis's ruling from taking effect until the appeal is heard.

The injunction lifted yesterday was issued as a result of a class action brought by a 19-year-old Virginia Beach woman identified only as Janet Doe. She contended that she was refused a Medicaid abortion at the Norfolk clinic on March 31 because the state law banning such abortions went into effect at that time.

During the year ending last June 30, Virginia financed abortions costing a total of $450,000 at a cost of about $125 per abortion, according to the complaint filed by lawyers for Doe.About 4,000 such abortions were paid for in all of 1977, according to state testimony in the case.

In the suit and at a hearing on the issue before Judge Lewis on May 16, attorneys for Doe contended that the state's policy denied her rights of privacy and liberty under the 14th Amendment and that it unlawfully discriminated against Medicaid-eligible women who seek abortions for health reasons.

Adams, representing the state, argued that the law did not prevent persons like Doe from getting abortions. In fact, Doe did receive an abortion later, even though the state refused to pay for it.

In his written opinion, Judge Lewis said the contention that Virginia's policy will exclude from Medicaid coverage most medically necessary therapeutic abortions "is not supported by the record "

The state'guideline, he said, is "very clear-it eliminates only reimbursement for abortions for which there were no good medical reasons."

The supreme Court has established, Lewis added, that states are not required to fund under their Medicaid Programs all abortions that are permissible under state law.

Virginia Health Commissioner James B. Kenley said in testimony in the case that the state's law would not rule out abortions for a number of reasons, including rape, incest or abortions to preserve the mental health of the mother.

As to the claim by opponents of the policy that indigent women are denied equal protection, Lewis cited the June 1977 Supreme Court decision. "The Constitution imposes no obligation on the states to pay the pregnancy-related medical expenses of indigent women, or indeed to pay any of the medical expenses of the indigents," the court said.