The Supreme Court Ruled, 7 to 2, yesterday that a state can give veterans an absolute and permanent preference in hiring without impermissibly discriminating against women.

The ruling upheld a Massachusetts law. Four other states - New Jersey, South Dakota, Utah and Washington - also have laws requiring that veterans who qualify for civil service jobs be considered for appointment ahead of any persons who also qualify but have not served in the military.

Virtually all other states and the federal government favor veterans, too, but with hiring preferences that do not go as far as the law in those five states. Their laws also are protected by the ruling.

Predictably, the decision won praise from veterans' organizations and denunciation from women's groups.

The American Legion's national commander, John M. Carey, said in Grand Blanc, Mich., that the decision was "a restatement of allegiance to the veterans' population of a grateful nation."

The high court recognized that veterans' hiring preferences have "never been intended to deny employment opportunity to any group whatsoever," Carey added.

The National Organization for Women interpreted the decision to mean "that more qualified women can be bypassed for less qualified men." Coupled with quotas on women in the armed services, the ruling guarantees that women "will always end up discriminated against i nthe civil service," said NOW president Eleanor Smeal.

Massachusetts' absolute preference law was found by a panel of three federal judges to have a devastating impact upon the state's employment of women. The Supreme Court acknowledged that the law "operates overwhelmingly to the advantage of males."

But, Justice Potter Stewart wrote for the majority, the discriminatory result doesn't answer the crucial question: whether the law discriminated against women in violation of the guarantee of equal protection of the laws in the 14th Amendment of the Constitution.

For a violation to be established, Stewart emphasized, a disproportionately adverse impact must be traced to a discriminatory purpose. That rule was laid down by the court in a line of decisions starting in 1976. Those decisions signaled that the 14th Amendment "guarantees equal laws, not equal results," Stewart said.

"Yet nothing in this record demonstrates that this preference . . . was originally devised or subsequently reenacted because it would accomplish the collateral goal of keeping women in a stereotype and predefined place in the Massachusetts civil service," Stewart said.

To the contrary, he continued, the history of the law, which in its first form was enacted in response to a perceived need to help a small group of older Civil War veterans at the end of the 19th century, "shows that the benefit of the preference was consistently offered to 'any person' who was a veteran."

Stewart termed veterans' preferences "an awkward - and, many argue, unfair - exception to the widely shared view that merit amd merit alone should prevail in the employment policies of government."

And, he said, "the substantial edge granted to veterans" by absolute and permanent preferences "may reflect unwise policy." But, he said, the Massachusetts woman who challenged the law, Helen B. Feeney of Dracut, "has simply failed to demonstrate that the law in any way reflects a purpose to discriminate on the basis of sex."

In the dissenting opinion, Justice Thurgood Marshall wrote that the absolute preference shows "purposeful gender-based discrimination" and "bears no substantial relationship to a legitimate governmental objective."

Emphasizing the availability of alternatives that wouldn't preclude all but a small fraction of Massachusetts women from getting jobs also wanted by men, Marshall found the law constitutionally impermissible. Justice William J. Brennam Jr. signed the dissent.

The three-judge Massachusetts panel based its invalidation of the law on its belief, like Marshall's, that the state's goal of aiding veterans could have been achieved readily with less drastic measure.

Feeney was denied civil service appointment three times. Once, despite having the second-highest test score, she was ranked behind four male veterans with lower scores. Later, she was ranked behind 11 veterans with lower scores.