The Supreme Court agreed yesterday to decide whether the Constitution allows a federal legislator to practice the sex discrimination that Congress prohibits elsewhere in government and in private employment.

The case, which effects the rights of thousands of Capitol Hill employes, involves former representative Otto E. Passman (D-La.) and Shirley Davis, who was his deputy administrative assistant.

Passman thought the world of Davis. In a June 1974 letter, he rated her "extremely capable," praised her "experience and talent," and termed her "able, energetic and a very hard worker. Certainly you command the respect of those with whom you work."

Then came the bad news. Because of "the unusually heavy workload . . . and the diversity of the job," Passman wrote, "I concluded that it was essential that theunderstudy to my administrative assistant be a man."

Thus fired, Davis, a Monroe, La., widow with two grown children, filed a lawsuit for back pay and other relief.

Ruling in her favor, a panel of the 5th U.S. Circuit Court of Appeals held 2 to 1 that she had been the victim of blatant sex discrimination in violation of the guarantee of equal protection of the laws in the Fifth Amendment.

In a 12-to-2 decision last April, however, the full appeals fourt reversed.

The fifth Amendment does not imply a right to bring a private action even though the Supreme Court ruled in 1971 that such a right is implied under another amendment, the Fourth, the majority said.

But it limited the reach of the decision, saying that it affects only "a congressional employe in the noncompetitive service whose allegedly discriminating employers are not in office" and doesn't preclude the possibility of equitable relief being sought from a federal legislator still in office.

Passman was defeated for renomination in 1976 after being in Congress for 30 years. He now is under indictment on charges of bribery and income tax evasion arising from the Korean influence-buying scandal.

Urging the Supreme Court to uphold the decision, Passman's attorney, A. Richard Gear, argued in a brief that Davis had held the kind of job in which the occupant "historically has been subject to discharge with or without cause."

But in a successful petition for review of the ruling, Davis's lawyer, Peter Barton Hutt, charged that it would "eviscerate" consitutional liberties "by permitting them to become mere rights with no remedies."