The Supreme Court yesterday denied recourse in the federal courts to long-haired highway travelers who were illegally stopped and searched for drugs solely because of their personal appearance.

The court let stand an appellate court ruling that the travelers could not rely on a federal civil rights law to seek relief from New Jersey State Police and state officials even though some troopers displayed "what can only be described as callous indifference . . . for the rights of citizens using New Jersey roads."

Seven justices voted without explanation to reject result is to advance two long-term trends of the court shutting the doors of federal court-houses to certain groups of litigants and giving a freer hand to law enforcers.

In a dissent, Justice Thurgood Marshall, Joined by Justice William J. Brennan Jr., emphasized a finding by the Third U.S. Circuit Court of Appeals that state police officials were "insensitive" "oblivious" and "indifferent" to complaints that the searches were unconstitutional.

The appellate court, while denouncing "the record of law enforcement abuses as it appears in this case," said that a 5-to-3 ruling by the Supreme Court last year barred a federal injunction.

The case involves stops and searches made over a three-year period starting in 1969. It has a bizarre legal history; before rendering a decision, one federal judge and then another died; a third retired.

Finally, Judge H. Curtis Meanor, in a ruling in November, 1975, said that some troopers had violated the Fourth Amendment with warrantless searches "where there was neither consent nor probable cause" and that were "not even arguably valid."

"Such patent violations of . . . constitutional rights cannot be tolerated in a society such as ours," Meanor said.

But he denied an injunction, saying that 34 invalid searches - among 66 cited in a lawsuit - should be seen against a background of "at least 1.5 million police contacts with automobile occupants" during the three-year period.

The invalid searches "were no more than willful and random acts on the part of a minority of troopers" and did not show a "deliberate pattern" of constitutional violations by the state police superintendent and the attorney general, Meanor said.

Last year, while the case was on appeal, Supreme Court handed down a decision reversing the Third Circuit's approval of a federal injunction against widespread police abuses in Philadelphia.

The decision, in the case Rizzo vs. Goode, caused some confusion in lower courts. The Harvard Law Review said that Justice William H. Rehnquist's opinion for the court could be read so as to nullify "the role of the federal judiciary as a guarantor of basic federal rights against state abuse."

So far as the Third Circuit was concerned, the decision meant that a federal court could not grant relief in the New Jersey case.

Marshall, in his dissent, said that the Third Circuit's view required Supreme Court scrutiny, especially because that view "results in the denial of relief to a large class of persons whose federal constitutional rights were repeatedly violated . . . When the opinion of this court that is the sole cause of the denial of relief is grounded in particular facts and contains alternative rationales, the case for granting [review] because compelling."

Marshall pointed out that the facts in the New Jersey case were stronger than in the Rizzo case. For example, New Jersey officials did nothing about repeated complaints of invalid searches: in Rizzo, what police officials knew about subordinates' violations was unceertain.

The court took other actions: FEDERALISM

The court agreed to review an Maska Supreme Court decision upholding a law requiring oil, gas and pipeline firms to give a hiring preference to state residents. OBSCENITY

The court agreed to decide whether a judge can instruct a jury to include children in the "community" whose standards determine whether material is obscene, even though none of the material in question was mailed to children PHYSICIAN RAPE

The court let stand, without comment, a ruling freeing Dr. William A. Abruzzi Jr., who had pleaded guilty to raping and sodemizing an unconscious patient in Wappingers Falls, N.Y. Lower courts said that the evidence against him had been obtained in an unconstitutional warrantless search. ABORTION

Over the dissent of three justices, the court let stand a decision invalidating an Idaho law that allowed state payments for an abortion deemed by two physicians to be "necessary to save the life or health of the mother . . ."