A worldwide moratorium on whaling by factory ships protecting all but the relatively small and populous Minke whale, was approved today by the International Whaling Commission at its annual meeting here.

The moratorium will protect - for the first time - the great majority of the world's remaining sperm whales. They have been seriously depleted by commercial whalers, who began killing them in large numbers after the blue, fin, humpback, gray and other great whales were hunted nearly into extinction. Almost 10,000 sperm whales were killed last year.

Today's action principally affects what remains of the whaling industries of the Soviet Union and Japan, which use factory ships as bases to which smaller hunting ships take the whales they kill for processing.

Leaders of the Soviet and Japanese delegations complained that they were being discriminated against by nonwhaling nations, including the United States, which helped engineer a compromise that produced the moratorium vote by more than the required three-fourths majority.

While the commission can directly enforce its actions only through internal pressure on members, it past quotas for catches and the protection of depleted species generally have been observed by member nations, which include nearly all of the world's remaining whaling countries.

"Pirate" whalers operating outside the control of any single nation have increased in numbers in recent years, but they, too, are expected to be more closely controlled if not eliminated by means discussed here this week.

Under international conservationist pressures, Japan has decided to stop buying whale products from the pirate whalers, South Africa has decided to stop allowing them to use its ports, and the United States has threatened retaliatory bans of fishing in U.S. waters against countries that violate or contribute to violations of international whale or fish conservation regulations such as those of the Whaling Commission.

Members of several delegations said they believe that the moratorium could destroy the Soviet Union's already declining whaling industry, which depends on harvesting sperm whales with factory ship fleets. The Japanese still will be able to hunt Minke Whales, mostly in the Antarctic Sea, with their remaining factory ship operations.

But the head of the Japanese delegation, Kunio Yonezawa, angrily told the other delegates after the vote that he wanted "to register my sense of resentment and displeasure at these discriminatory measures, which were introduced in a most discriminatory way. Japan's plea for fair treatment and justice has been disregarded."

"We find no significance in sitting with you in good faith," he said in what some delegates took as a threat that the Japanese might pull out of the Whaling Commission.

The Japanese and other remaining whaling nations were warned this week by two visiting U.S. congressmen, Pete McCloskey (R-Calif.) and Donald Bonker (D-Wash.), for under legislation nearing final passage in Congress they could be banned from fishing within the U.S. 200-mile territorial limit if they violate international conservation measures such as those enacted by the commission. Japan, the Soviet Union and South Korea, another whaling nation, are dependent on extensive commercial fishing in U.S. waters.

A further U.S. proposal to extend the moratorium to all whaling in the world - including the less extensive whaling by Norway, Denmark, Iceland, Spain, Brazil, Chile, Peru and a few other nations with land-based boats operating under Whaling Commission restrictions on their range - failed to win a three-fourths majority among the Whaling Commission's 23 member nations. Many of these countries are, however, phasing out their coastal whaling operations anyway because of its growing unprofitability and international conservationist pressures.

Delegations that supported the ban on whaling by factory ships but not a complete moratorium on whaling explained that coastal whaling also was easier to monitor and included "aboriginal" whaling for self-preservation by people like the Eskimos. However, the Whaling Commission also approved today an Australian-proposed study on how to ban all but possibly aboriginal whaling. That study must be presented to the Whaling Commission for possibile action next year. Japan registered the only objection to that study.

On Thursday, the commission will consider proposals by the Indian Ocean island nation of Seychelles to ban land-based as well as factory ship hunting of sperm whales for at least three years and to make most of the Indian Ocean a refuge for whales. Close votes are expected on both proposals.

Most of the many conservationists observing the Whaling Commission's deliberations here were jubilant about the ban on factory ship whaling. It was called "a major victory for the whales" and, in the words of a conservationist on the official U.S. delegation, Thomas Garrett, "the biggest single advance this commission has taken."

But they feared that protection for the sperm whale may be coming too late. Of all the endangered great whales under Whaling Commission protection, they said, only the California Gray Whale, first protected from killing by the United States 40 years ago, has increased in numbers. The others, and possibly the sperm whale as well, they fear, are already so near extinction that their survival is problematical.

Lewis Regenstein, executive vice president of the Fund for Animals, said he is now concerned about the survival of the Minke whales, which also would be exempted from the pending proposal for an Indian Ocean whale sanctuary.

Exempting the Minke whales in today's moratorium won needed votes for the factory ship ban from Whaling Commission members who feared that Japan would otherwise leave the commission.

More than 20,000 whales were killed under whaling commission quotas last year. As a result of today's moratorium vote and quotas still to be finally set for Minke whales, perhaps half that many will be killed in 1980. CAPTION: Picture, Members of a conservation group, Greenpeace, approached Soviet whaling vessel in a past protest effort. Greenpeace Foundation Photo