Over the objections of some White House aides, the Justice Department yesterday filed a legal brief with the Supreme Court contending that laws that give veterans a preference in government jobs are constitutional.

News of the department's position stirred indignation among women's groups and some federal officials who have fought to have such preferences curtailed.

Throughout the debate over civil service reorganization, earlier this year, President Carter had called for cutbacks in the lifelong job preferences extended to 30 million veterans, a group that is 98 percent male and 92 percent white. That issue was the only minor one the president lost when Congress approved the historic civil service legislation in October.

Several White House aides spent the weekend trying to talk the office of the solicitor general out of filing the brief, or at least into modifying it substantially because they feel it does not accurately reflect the president's views, White House sources said. The offices of Stuart Eizenstat, Carter's top domestic policy adviser, counsel to the president Robert Lipshutz and Sarah Weddington, Carter's adviser on women's issues, were doing the "dickering" for the White House, the sources said.

Deputy Solicitor General Frank H. Easterbrook, who wrote the brief, said his office views the brief as "completely supporting the president's position."

The real question here," he said, "goes to who's in charge here: the president and the Congress, or the judicial branch? We're saying it's not the courts...If somebody is going to change these statutes, it should be the president and the Congress."

The Justice Department filed the brief as a friend of the court in the case of Helen B. Feeney, a former Massachusetts state employe who was stymied in her attempts to change jobs when veterans were given preference over her.

A U.S. court in Massachusetts last spring ruled that the state's veterans preference statute was unconstitutional because it "deprives women of equal protection of the law."

The Justice Department brief has been in the works since Oct. 10, when the Supreme Court agreed to hear the case, Easterbrook said. He and other government sources said the brief had been circulated widely for comment and that certain changes had been made along the way in response to the concerns of the White House and other agencies.

"I assume the President could have instructed us not to file the brief," Easterbrook said. However, he noted also that one of the articles of impeachment against President Richard Nixon contained the argument that the president was "trying to tell the Justice Department what to do."

The 38-page Justice Department brief states that the U.S. "has an interest in participating in the case in order to defend those portions of the federal veterans preference laws that might be affected by the court's ruling."

If the court finds in favor of Massachusetts, it could jeopardize the whole range of U.S. benefits given to veterans in housing, education and numberous other categories, according to Easterbrook and other officials.

The Justice Department argument, as summed up in the brief, is that the state did not "purposefully discriminate against women" in enacting the statute and that "only purposeful discrimination violates the equal protection clause" of the Constitution. Moreover, the brief contends that governments have legitimate reasons for adopting veterans' statutes.

Any discrimination resulting from the statute, however unintentionally, is partly a result of women's exclusion from the military, the brief states, adding that "it is by no means clear that the restrictions on women's participation in the military are unconstitutional."

Sometimes, the brief said, "military gender distinctions operate to the disadvantage of men, not in their favor."

Although the brief upholds the constitutionality of the concept of veterans preferences, Easterbrook said, it does not hold that all veterans preference statutes necessarily are constitutional.

A number of executive branch officials, including several women, and women's group leaders said over the weekend that they were dismayed to learn of the brief's thrust.

"It's absurd to have these people in the solicitor general's office taking a position opposite to that of the president," said Judith Lichtman, executive director of the women's Legal Defense Fund.

Some sources suggested the solicitor general's office is developing a "history of differing with the administration position, and they cited previous Supreme Court cases -- one involving the snail darter and the Bakke case, involving so-called reverse discrimination -- in which this had occurred.

Easterbrook and other government sources responded that such disagreements "happen all the time," as part of standard operating procedures.