The Senate yesterday narrowly failed to override President Bush's veto of a bill to liberalize the half-century-old Hatch Act, which bans most partisan political activity by federal workers.

The vote was 65 to 35, two votes shy of the two-thirds majority needed to override a presidential veto. It was Bush's 12th straight veto victory in Congress.

Sen. William V. Roth Jr. (R-Del.), leader of the Bush forces, called the vote to sustain the president's veto "a victory. . . . The Hatch Act as it exists protects federal employees from coercion." Roth said the legislation was opposed by Common Cause, the American Bar Association, the Federal Bar Association, the National Association of Public Administration, the Chamber of Commerce and the American Farm Bureau.

Sen. John Glenn (D-Ohio), chief sponsor of the measure, said he was "disappointed" and "wouldn't try it again next year. We've got to get the votes lined up in advance before we go through this again."

The Hatch Act, passed in 1939 after reports that New Deal employees were being coerced to support the reelection campaign of President Franklin D. Roosevelt, bars federal workers from active public participation in partisan politics although they are allowed to vote, to contribute money, and to express private opinions.

The vetoed measure would have enabled federal workers to participate in partisan politics while off duty. Although it would have continued to ban federal workers from running for office or soliciting campaign contributions from the public, it contained a highly controversial provision allowing federal workers to ask other members of the same labor union for contributions to a multi-candidate political action committee.

Three Republican senators who voted last month to revise the Hatch Act changed their minds yesterday and voted with the president:Sen. Trent Lott (Miss.), who signed on as a cosponsor of the bill on April 7, 1989, was "moved by some of the arguments about mischief and . . . possible coercion within federal agencies" and decided yesterday morning to vote with the president, according to Susan Irby, his floor assistant. Sen. Pete V. Domenici (N.M.), who supported the measure when it first came to the Senate floor May 10, said in a statement he "is for appropriate Hatch Act reform" but wanted some changes made in conference committee that did not occur. Sen. Alfonse M. D'Amato (N.Y.), another May supporter, was said by his staff to be "tied up on the floor with the housing bill" and unable to explain his change of heart.

Robert Tobias, president of the National Treasury Employees Union, said the senators "melted like so much Silly Putty under a little heat from the White House."

George Gould, chief lobbyist for the National Association of Letter Carriers, expressed bitterness that D'Amato had "insisted we participate in a fund-raising golf tournament in New York" recently, telling the postal union, "I'm with you and I need you to show your early support for my reelection."

Gould said he had agreed only two days ago to "put together a fund-raiser for Trent Lott" at the request of his staff.

All 55 Senate Democrats voted to override the veto, along with 10 Republicans including Virginia Sen. John W. Warner. Warner said his 48 years of experience in and around government had convinced him that the Hatch Act needed change.

Glenn cited examples yesterday of what he described as "confusing and illogical" regulations needed to interpret the law: federal workers can place a sign on their lawn, but can't wave it at a political rally; they can express an opinion, but not give a speech.

White House press secretary Marlin Fitzwater said, "We are pleased that that vote was sustained. We felt that it {the revisions} incorrectly politicized the civil service."

Sen. Alan K. Simpson (R-Wyo.) suggested that some Democrats supported the legislation because most PAC contributions from federal and postal unions go to them.

Bush vetoed the bill Friday, saying it "would inevitably lead to repoliticizing the federal work force" and would "destroy its essential political neutrality."

The House, with nearly half of its Republicans abandoning the administration, voted 327-93 Wednesday to override the veto.