The Justice Department is preparing legislation intended to overturn a two-week-old U.S. Supreme Court decision that allows only direct purchasers, including the federal government, the states and other consumers - to sue antitrust violators for damages.

Acting Assistant Attorney General John H. Shenefield said yesterday that "from what I know of the views of the President on competition, this is precisely the kind of thing he would care about."

With the support of Attorney General Griffin B. Bell, Shenefield said, he is drafting a bill for submission to the White House.

Similar legislation may be introduced in a few days by the chairmen of the antitrust subcommittees on Capitol Hill, Sen. Edward M. Kennedy (D-Mass.) and Rep. Peter W. Rodino Jr. (D-N.J.)

The 6-to-3 decision on June 9 appears to have wiped out federal antitrust claims of $205 million in the government's top three pending cases alone.

The cases involved purchases of reinforced steel bars, an antibiotic called ampicillin, and antibiotics in the tetracycline family. The law permits the government to sue only for single damages.

The decision also appears to have wiped out claims for $100 million by several states in a variety of antitrust suits. States sue for triple damages.

Earlier in the day, the National Association of Attorneys General launched a campaign to overturn the decision. They put together a coalition of consumers and other groups.

C. Raymond Marvin, Washington counsel for the association, told a meeting of the group and its allies at the Hall of the States building that the decision "devastates" the ability of the states to sue suppliers who fix prices because 80 per cent to 90 per cent of state procurment is made through middlemen. Most other consumers, also normally buy through middlemen. The decision, however, preserves the right of middlemen to sue for treble damages even if they have passed on or profited from the illegal overcharges.

Justice Byron R. White, who wrote the opinion, said that the decision nulified a law enacted last year that authorized states to sue antitrust violators in behalf of groups of citizens who were overcharged for items such as bread, milk and gasoline.

Former Sen. Joseph D. Tydings (D-Md.) told the meeting that the fight to upset the decision will bring lobbyists for major industries "swarming into Washington and can be won only with "all-out support" from President Carter.