The Supreme Court said yesterday that federal judges have broad discretion in deciding whether to issue orders ending water pollution.

The justices said the 1st U.S. Circuit Court of Appeals improperly ordered the Navy to cease air-to-ground target practice on an island off Puerto Rico until it could obtain a permit from the Environmental Protection Agency.

Puerto Rican government officials sued the Navy in 1978 after some of the shells landed in the water surrounding Vieques Island. They said the Navy was polluting the oceans without the permit required under the Federal Water Pollution Control Act.

A U.S. district court agreed that the Navy needed a permit, but refused to order the target practice halted while the government applied for one. The appeals court reversed, saying the district court was required to order immediate cessation of the shelling.

It cited a ruling in the Supreme Court's 1978 term in favor of a similar injunction to protect an endangered species--the snail darter--from destruction by the Tellico Dam project.

Justice Byron R. White, writing the Supreme Court's 8-to-1 decision yesterday, said federal judges are not "mechanically obligated to grant an injunction for every violation of the law."

He said the Endangered Species Act, under which the Tellico Dam order was issued, contained a "flat ban on the destruction of critical habitats" that justified the immediate order in that case.

The water pollution law at issue yesterday in Weinberger vs. Romero-Barcelo allows flexibility for judges, according to the immediate harm at hand and the "public consequences" of an order. White said the order in question need not have been issued before a determination that the shelling was actually polluting.

Justice John Paul Stevens dissented, saying that Congress intended the courts to act swiftly in such situations.

A separate opinion yesterday, in which the court rejected an appellate court's finding of intentional discrimination in a job seniority system, illustrated again the legal confusion over determining "intent" and "motive" in discrimination cases.

Black employes at a now closed Pullman-Standard plant in Bessemer, Ala., had challenged the seniority system there as discriminatory in 1971. In its 1977 term, in a case involving the Teamsters union, the Supreme Court made it harder to win such challenges, ruling that the system must have been constructed with a discriminatory motive before it could be declared illegal.

But in job discrimination cases, as in voting rights controversies about intent, the justices have not provided any clear guidelines for deciding when discrimination is intentional.

The district court in yesterday's case said the system used by Pullman-Standard, under agreements with the United Steelworkers of America and the International Association of Machinists, was not discriminatory under the Teamsters test.

The Fifth Circuit said it was. The Supreme Court sent the whole issue back for another trial on the question. It will be the fourth trial in this case, according to Barry Goldstein, an attorney for the black employes.

In a 7-to-2 judgment, Justice White said the question of intent was a question of fact. Under federal rules, appellate courts may only reverse "clearly erroneous" findings of fact by district courts. In this case, he said, the district court's original ruling was not clearly erroneous.

White said "the Court of Appeals made its own determination as to the motives" and simply substituted it for that of the district court.

Justices Thurgood Marshall and Harry A. Blackmun dissented. Marshall said he disagreed with the Teamsters decision and with yesterday's application of it. Justice Stevens wrote a separate concurrence in the case, Pullman-Standard vs. Swint.