The House voted 334 to 87 yesterday to lift many of the restrictions on political activity that have prevented federal workers from participating in partisan politics for the past 51 years.

Rep. William D. Ford (D-Mich.), chairman of the House Post Office and Civil Service Committee, called the measure "the political emancipation of 3 million federal workers," who now will be able to hold

office in a political party, work

for a political organization or work in a political campaign while off duty.

The bill now goes to the

president, who has threatened to veto it because it "politicizes the civil service," according to White House press secretary Marlin Fitzwater.

The apparently veto-proof margin of support for the measure in the House is not echoed in the Senate, where the bill passed with 67 votes, the bare minimum necessary to override a veto.

"We only need a vote or two," said Sen. William V. Roth Jr. (R-Del.), the leader of Senate opposition to the Hatch Act changes, which would affect more than 3

million federal and postal work- ers. "I think we can persuade enough people to support the president."

The Hatch Act, passed in 1939 to prevent Depression-era workers from being coerced to help in the reelection campaign of President Franklin D. Roosevelt, has developed into a welter of regulations preventing civil servants from participating in most partisan political activities.

The House, in a bill passed in April, lifted virtually all restrictions on off-duty political activity. The Senate, in a bill passed May 10,

left intact prohibitions against running for partisan political office

and soliciting funds from the pub- lic.

The House passed the Senate version yesterday.

Even so, the Justice Department, in a letter yesterday to House Minority Whip Newt Gingrich (R-Ga.), expressed "grave and unequivocal objections" to the bill.

"The {Hatch} Act's ban on active partisan campaigning by federal employees protects them from coercion and patronage abuse. These protections remain essential to assure the integrity of the federal work force and the administration of federal programs," the letter said.

Supporters of the measure said they were "politely rebuffed" in attempts to open discussions with the White House on a compromise the president would sign.

Rep. William Clay (D-Mo.), a sponsor of Hatch Act revision measures for 15 years, said federal employees are currently "political eunuchs" because of "this archaic law."

He said the bill contains strong enforcement provisions protecting federal workers from being coerced to participate in political campaigns or contribute to political candidates. There is a flat ban on solicitation of a subordinate.

However, said Rep. Frank Wolf (R-Va.), "what is permitted will be expected." He said that as a former federal employee, he was convinced that "federal workers' real desires are not for this."

The Hatch Act provides civil servants important protections, he said. "Federal employees will no longer be able to say, 'I wish I could, but.' "

Federal unions are among the principal supporters of the Hatch Act revisions that passed yesterday. As these unions are prohibited from bargaining over wages and benefits and from striking to achieve their goals, many union leaders view their ability to influence Congress as a life-or-death matter for their organizations.

Federal and postal unions contribute several million dollars to congressional campaigns each election year. The Hatch Act revision bill passed yesterday allows federal workers to solicit funds from other members of the same federal labor organization for a multi-candidate political action committee.

Republicans repeatedly pointed out during debate that virtually

90 percent of such federal-postal PAC contributions went to Democrats.

In the House vote, however, 90 Republicans supported the measure, with 84 opposed. Only three Democrats voted no.