A housing bill that backers call the most important civil rights measure in nearly a generation passed the House overwhelmingly yesterday, 310 to 95. A move to kill its key provision failed, 209 to 196.

Lobbyists for civil rights organizations, unions and religious and welfare groups smiled jubilantly in the House corridor as the bill, backed by President Carter, was steered to passage by Reps. Don Edwards (D-Calif.), Tom Railsback (R-Ill.) and Robert McClory (R-Ill.).

The president, in a statement after the vote, said, "This bill provides the enforcement powers that the nation's fair housing act needs, and I hope the Senate will pass it quickly."

"This is a demonstration that the movement to eliminate racism is still alive and kicking," said William L. Taylor, an official of the Leadership Conference on Civil Rights, which consists of more than 100 organizations.

The bill, designed to put teeth into a 1968 housing antidiscrimination law by permitting enforcement by federal agencies instead of making injured parties sue in court, was opposed by real estate groups and organizations of real estate agents.

The battle now moves to the Senate, where a Judiciary subcommittee sent a substantially weakened version of the measure to the full Judiciary Committee yesterday. It contains several provisions similar to the House bill but lacks the crucial administrative enforcement mechanism.

Sen. Birch Bayh (D-Ind.), chairman of the subcommittee, said he believes the full Judiciary Committee will restore the bill to the stronger form favored by civil rights groups. He said the only thing that could provide trouble would be a minority filibuster on the floor.

Sen. Howard Metzenbaum (D-Ohio), a Judiciary member who favors a strong enforcement mechanism, said, "It's going to be a tough fight in committee but we've got a good shot at it. On the floor we should be able to hold what we get from committee. We'll have to do some arm-twisting and cajoling but I expect a good bill to be signed into law."

There are already many state and local fair housing laws across the country. But their application is uneven, and when they lead to litigation, it is generally in state courts. The new law would add to these a national enforcement mechanism.

Like the 1968 bill that preceded them, the new bills cover both sale and rental of housing.

Edwards told the House yesterday that because persons who suffer discrimination can't go to a federal agency for help and must go through lengthy, costly and difficult civil law-suits, the 1968 law has become "a nullity with no real enforcement machinery."

He said the new legislation would correct that by allowing the Department of Housing and Urban Development to take jurisdiction of complaints and put them before government hearing examiners (administrative law judges) for quick decision and enforcement orders. Violators would be subject to fines of up to $10,000.

Edwards said 21-month delays in courts are routine but the new administrative law judge procedure would provide "quick, cheap resolution" of complaints.Persons suffering discrimination could also file civil suits as at present.

Enforcement orders by such judges could be appealed to the courts.

Additional provisions of the House bill bar mortgage "redlining" by banks and other lenders and ban discrimination in the sale of housing insurance and in appraisals.

The bill would also make the anti-discrimination language, and the various precedures to enforce it, applicable to discrimination against handicapped persons. The 1968 law already applied to discrimination based on sex, race, religion, color and national origin.

An added provision, which President Carter opposes, would give Congress a legislative veto over government agency regulations issued under the housing antibias law.

Civil rights backers viewed the HUD and administrative law judge procedure as by far the most important provision of the bill.

They bitterly opposed a move by Rep. F. James Sensenbrenner (R-Wis.) to strip out the administrative procedure and place enforcement in federal courts and magistrates, saying this would "gut" the bill and leave enforcement as weak as it has been for the past dozen years.

Sensenbrenner, who denied his move would gut the bill, was beaten by one vote, 205 to 204, in a test of strength Wednesday night. He tried again yesterday just before final passage and lost again, 209 to 196.

However, the Senate Judiciary subcommittee bill deleted the administrative law judge procedure in favor of courts and magistrates, and it is this decision that civil rights groups hope to reverse in full committee.

In yesterday's House vote on passage, 223 Democrats and 87 Republicans voted for the bill, while 28 Democrats and 67 Republicans opposed it. In the Maryland and Virginia delegation, all Maryland Democrats plus Virginia Reps. Joseph L. Fisher (D), Herb Harris (D) and William Wampler (R) voted for the bill. Others opposed it.

According to the Congressional Budget Office, the bill would require at least 115 new government personnel: seven administrative law judges, 50 HUD field investigators, 12 lawyers in HUD and five in the Justice Department, plus clerical, secretarial and related staff aides.