The Senate yesterday overwhelmingly passed legislation designed to overturn a 1984 Supreme Court decision that restricted the reach of civil rights laws, but attached a controversial amendment that would allow universities and hospitals that receive federal funds to refuse to pay for or perform abortions.

The amendment greatly diminished the legislation's appeal for civil rights groups.

The measure, approved 75 to 14, would undo the Supreme Court's 1984 decision that limited the reach of federal laws barring recipients of federal funds from discriminating against women, minorities, the elderly and the disabled. The 6-to-3 ruling, in Grove City College v. Bell, said the laws affected only the specific "program or activity" that receives the funding not the entire institution.

In other words, if a university's physics department received federal aid, under the Grove City decision, its athletic program or English department remains free to discriminate on the basis of sex. Under the law passed yesterday, the entire university would be covered by the federal law if any part of it received federal funds.

Sen. Edward M. Kennedy (D-Mass.), the chief Senate sponsor of the Civil Rights Restoration Act, hailed the vote as a "long overdue" act that "closes enormous loopholes in the nation's civil rights laws."

He said, however, that the abortion amendment constitutes "a disturbing dilution of the protections which women currently enjoy."

In a last-minute effort to whittle down the majority in favor of the measure, President Reagan sent a "Dear Orrin" letter late yesterday afternoon to Sen. Orrin G. Hatch (R-Utah), the chief Senate opponent of the legislation, calling the bill "unacceptable to me."

Hatch told the Senate that Reagan's letter "means as it presently exists, even with the {abortion} amendment, it will be vetoed."

Kennedy said that he doubted the president would veto the bill, but said he was confident the veto could be overridden.

The bill is pending in a House subcommittee. Three years ago, the House approved a similar measure by an overwhelming majority but it was stalled in the Senate by a filibuster.

The abortion amendment, sponsored by Sen. John C. Danforth (R-Mo.), passed by a wider-than-expected margin of 56 to 39. Federal regulations require that educational institutions that receive federal funds and offer comprehensive health plans, offer plans that pay for abortions.

Supporters of the legislation handily defeated a number of administration-backed amendments designed to narrow the reach of the legislation.

The high court's ruling in Grove City on the reach of laws prohibiting colleges and universities from discriminating on the basis of sex -- backed by the Reagan administration -- also narrowed the reach of similar laws prohibiting recipients of federal funding from discriminating against minorities, the elderly and the disabled.

Civil rights groups have battled for four years for legislation to overturn Grove City, contending that it created a gaping hole in the coverage of civil rights laws and resulted in having federal tax dollars subsidize discrimination.

But opponents assert that the legislation is unnecessarily broad, going far beyond the law before Grove City and would subject a broad array of private employers and institutions to antidiscrimination laws and threaten religious freedom.

In a statement issued on the first day of debate earlier this week, the Justice Department decried the proposal, calling it "one of the greatest expansions of federal power in the post World War II era," saying that such "sweeping expansion of federal authority . . . is utterly unjustified and is contrary to the principles that underlie the Constitution."

The administration instead backed a measure that would have been limited to educational institutions and broaden an existing exemption for those controlled by religious institutions to also excuse schools "closely identified with the tenets of a religious organization."

That measure, sponsored by Hatch as an amendment to the Kennedy proposal, failed yesterday, 75 to 19.

Both sides mobilized their forces on the Danforth abortion amendment.

Vice President Bush flew in to preside over the Senate in case his vote was needed to break a tie, and Senate Minority Leader Robert J. Dole (R-Kan.) also returned from the campaign trail to vote in favor of the amendment.

Democratic presidential hopeful Sen. Paul Simon (Ill.) canceled a speech and fund-raiser in Texas to cast a vote against the amendment at Kennedy's request.

Danforth argued that "it would be an absolute outrage . . . for the Congress of the United States to force on Georgetown {University} or Notre Dame or the city of St. Louis a policy that under the Hyde Amendment {restricting federal funding for abortion} we don't support ourselves."

But opponents of the amendment contended that religious institutions opposed to abortion could obtain exemptions under the existing law and that the amendment could allow discrimination against women who had abortions.

Abortion-rights activists and feminist groups were particularly upset about passage of the amendment, which forces the civil rights coalition pushing for the measure to reconsider its strategy.

"It cripples the bill," said Kate Michelman of the National Abortion Rights Action League.

"We will not take this amendment," said National Organization for Women President Molly Yard.

But Ralph G. Neas, executive director of the Leadership Conference for Civil Rights, said that while the Danforth amendment "was a disappointing setback, there was an overwhelming rejection of the Reagan administration's attempts to weaken" the legislation.

Msgr. Daniel Hoye, secretary to the National Conference of Catholic Bishops, said the "United States Catholic Conference is deeply gratified that the Senate has enacted an abortion neutral amendment to the Civil Rights Restoration Act."