The Supreme Court ruled 9 to 0 yesterday that a state cannot try to get jobs for its own residents by requiring employers to discriminate against nonresidents.

The court said that Justice Benjamin Cardozo defined the issue in 1935, when he wrote that the Constitution "was framed upon the theory that the peoples of the several states must sink or swim together, and that in the long run prosperity and salvation are in union and not division."

The unanimous ruling invalidated the Alaska Hire Law, which was intended to lower an unemployment rate that is regularly the highest or one of the highest in the country. In the first four months of this year, the rate ranged from 11.5 percent to 12.6 percent. In no other state did the rate top 10 percent.

The law tried to force pipeline and virtually all other companies involved in developing the state's vast oil and gas resources to favor "qualified Alaska residents" by hiring them first and laying them off last. As of June 1976, the law applied to about 12,000 jobs (6 percent of total employment), reserving about 9,000 of them for Alaskans.

Several nonresidents who were barred from pipeline jobs by the law sued to overturn it, mainly on the basis of the requirement in the federal Constitution that the citizens of each state have "all privileges and immunities of citizens in the several states."

They lost in a state trial court and again in a divided Alaska Supreme Court, which emphasized that the residents of the state own its resources.

In the opinion reversing the state high court, Justice William J. Brennan Jr. wrote that the law "fails to pass constitutional muster" because the "pervasive discrimination" it inflicts on nonresidents bears no "substantial relationship to the particular 'evil' they are said to represent."

A law granting a hiring preference to residents who are unemployed or enrolled in job training programs might be permissible, but the "across-the-board grant of a job preference to all Alaskan residents clearly is not," Brennan said.

Moreover, he said, the law is so extreme that it covers employers with no connection at all to the state's oil and gas, including "suppliers who provide goods or services to subcontractors despite the fact that none of these employers . . . ever set foot or state land."

The court handed down other decision: UNION ORGANIZING

The court ruled that an employer who disapproved of the content of union news bulletins could not bar the distribution of the flyers in nonwork areas.

The 7-to-2 decision involved Eastex Inc., which makes paper products in Silsbee, Tex., and Local 801 of the United Paperworkers International Union, the representative of many of the approximately 800 production workers.

Four years ago, when negotiations for a new contract were about to begin, the local sought to preserve a "good relationship" with Eastex by asking permission to distribute a bulletin in nonwork areas.

The company refused on the ground that in addition to dealing with two topics of undisputed relevance to collective bargaining, two sections of the bulletin dealt with political issues, a proposed change in the state right-to-work laws and President Nixon's veto of a minimum wage increase.

The local complained to the National Labor Relations Board. It held that the guarantee in federal labor law of the right of employes to engage in concerted activities for "mutual aid or protection" covered distribution of the bulletin, partly because "right to work" affects union security, and federal minimum wages affect negotiated wages. The 5th U.S. Circuit Court of Appeals agreed and was affirmed yesterday in an opinion by Justice Lewis F. Powell Jr.

Justice William H. Rehnquist dissented. Joined by Chief Justice Warren E. Burger, he wrote that "Congress never intended to require the opening of private property to the sort of political advocacy involved in this case." HOWARD HUGHES

Without explanation, the court rebuffed an effort by California to enlist it in settling a dispute with Texas about which state is empowered to collect death taxes from the estate of the late Howard R. Hughes, the multimillionaire recluse. California fears it may end up with a valid but uncollectable tax judgement for about $21 million.