The Supreme Court yesterday eased its historic restraints on public aid to religious schools by upholding a Minnesota law that allows tax deductions for the costs of public, parochial and other private education.

It was the first time that the court has approved any program of substantial tuition relief for the parents of private school students.

The court said in a 5-to-4 decision that the Minnesota law, unlike those previously struck down, survives the Constitution's ban on government promotion of religion largely because it "neutrally" provides some benefits to all parents, not just to those with children in parochial school.

The court said that, while parents of children in parochial school are the primary beneficiaries of the Minnesota law because they may deduct part of their tuition costs from their gross income, the parents of public school students also may deduct such costs as transportation, special books or fees and course-related equipment.

Opponents immediately charged that the decision threatens the public schools.

"Tuition tax credits, in whatever form they may appear, divert badly needed tax resources away from the 90 percent of America's children who go to public schools," said Willard McGuire, president of the National Education Association.

The ruling could trigger legislative proposals throughout the country on what has traditionally been one of the nation's most contentious political issues. There are about 5 million private school students in the United States, most of them in Catholic schools.

Yesterday's decision provides a constitutional formula for tuition tax credit proposals. It is a costly formula, however, that could create fiscal and political obstacles at a time of rising concern about federal and state budgets and of complaints about insufficient funding for public education.

In fiscal 1984, Minnesota officials estimated yesterday, $42 million in tax deductions under the law will cost the state $5.4 million in revenue.

In the past, the court has upheld only minor private school aid plans, such as state reimbursement of transportation costs and the lending of textbooks to private school children. However, aid as inconsequential as reimbursement for costs of administering tests required by state education laws has been struck down by the court.

Under the ruling, written by Justice William H. Rehnquist, the Reagan administration's tuition tax credit proposal for private school aid that is currently before Congress would probably have to be modified substantially, increasing its cost. It does not now include public school parents among its beneficiaries.

Solicitor General Rex E. Lee, who, on behalf of the Reagan administration, had sought the decision that the court reached, called it "an important new beachhead. It is a major breakthrough," he said. "Most of the cases in recent years have gone the other way."

Burt Neuborne, legal director of the American Civil Liberties Union, which challenged the Minnesota law, agreed that "They've never approved anything which has this much potential for providing general support for parochial education. My fear is that people are going to read this as a green light . . . . But, I question whether Congress and the legislatures are prepared to make this kind of expenditure. There's no cut-rate way to do this."

Chief Justice Warren E. Burger and Justices Byron R. White, Lewis F. Powell Jr. and Sandra Day O'Connor joined Rehnquist's opinion. Justices Thurgood Marshall wrote a dissent, joined by Justices William J. Brennan Jr., Harry A. Blackmun and John Paul Stevens.

The Minnesota law, Marshall said, "is little more than a subsidy of tuition masquerading as a subsidy of general educational expenses . . . . This result is flatly at odds with the fundamental principle that a state may provide no financial support whatsoever to promote religion."

The constitutional provision at issue yesterday is the First Amendment's "establishment clause," which forbids laws "respecting an establishment of religion."

The 30-year-old Minnesota law allows taxpayers who itemize deductions when computing their state income tax to deduct up to $500 for each child in kindergarten through the sixth grade and up to $700 for each child in the seventh through 12th grade. About 820,000 children attend school in the state, of which 91,000 go to private, mostly sectarian, schools.

Minnesota officials say that there are no reliable statistics on the relative flow of benefits to the parents of children in public schools although 110,000 public school parents claimed education expense deductions in 1980.

Only a handful of public school parents, those whose children crossed county lines to attend school, pay tuition in Minnesota.

The ACLU estimates that 75 percent of the financial benefit goes to the parents of children in sectarian schools.

Rehnquist, affirming the 8th U.S. Circuit Court of Appeals yesterday in Mueller et al vs. Allen et al, said that it was not necessary to engage in a detailed "empirical inquiry" into who benefits.

He said the Minnesota law passed the court's three-pronged test of constitutionality because it is secular in purpose, does not have "the primary effect of advancing the sectarian aims of the non-public schools" and does not foster excessive entanglement between church and state.

It aids all students, he said, and is, thus, "vitally" different from the New York law struck down by the court in 1973 in Committee for Public Education vs. Nyquist that provided tuition "grants" only to the parents of private school students. The Minnesota law "neutrally" provides benefits to a "broad spectrum of citizens," he said.

It favors no specific religion because it is the parents, through their tax deductions, rather than state officials through direct aid grants, who decide where the benefits go, Rehnquist said. "Where, as here, aid to parochial schools is available only as a result of decisions of individual parents, no imprimatur of state approval . . . can be deemed to have been conferred on any particular religion or on religion generally.

" . . . It is true, of course, that financial assistance provided to parents ultimately has an economic effect comparable to that of aid given directly to the schools attended by their children," he said. "It is also true, however, that under Minnesota's arrangement public funds become available only as a result of numerous private choices of individual parents of school-age children.

"An essential feature of Minnesota's arrangement is the fact that the deduction is only one among many deductions--such as those for medical expenses and charitable contributions . . . available under the Minnesota tax laws," he said. The court gives "great deference" to the taxing authority of state legislatures, he added.

"A state's decision to defray the cost of educational expenses incurred by parents--regardless of the type of schools their children attend--evidences a purpose that is both secular and understandable," he said. "An educated populace is esssential to the political and economic health of any community, and a state's efforts to assist parents in meeting the rising cost of educational expenses plainly services this secular purpose of ensuring that the state's citizenry is well educated.

"Similarly," he said, "Minnesota, like other states could conclude that there is a strong public interest in assuring the continued financial health of private schools, both sectarian and non-sectarian."

The dissenters, led by Marshall, said that they believe the constitution forbids "any tax benefit . . . which subsidizes tuition payments to sectarian schools." The Minnesota scheme, like the New York law invalidated in 1973, "has a direct and immediate effect of advancing religion," they said.

" . . . Parents who send their children to free public schools are simply ineligible to obtain the full benefit of the deduction, except in the unlikely event that they buy $700 worth of pencils, notebooks and bus rides for their school age children," Marshall wrote.

" . . . What is of controlling significance is not the form but the substantive impact of the financial aid," he said.

Quoting the 1973 ruling on the New York law, he added, " 'Insofar as such benefits render assistance to parents who send their children to sectarian schools, their purpose and inevitable effect are to aid and advance those religious institutions.' "