DES MOINES, JULY 3 -- Rep. Richard A. Gephardt (Mo.), in one of the sharpest attacks of the Democratic presidential campaign, denounced the trade policies of Massachusetts Gov. Michael S. Dukakis today and accused him of distorting his state's economic recovery.

At a breakfast speech to about 40 local Democrats and at a news conference later, Gephardt charged that Dukakis "is looking at this trade issue through a regional prism . . . . The Dukakis trade policy is a lot like the Reagan policy."

Gephardt described the Reagan administration trade policy as "talk about it a lot but do very little."

Gephardt then challenged Dukakis' claim that he restored economic vitality to the Masschusetts economy. Dukakis may have initiated effective programs, Gephardt said, but "to say that is the only reason they have had an economic miracle in Massachusetts, I don't think is in touch with the facts."

A significant factor in the state's economic boom, according to Gephardt, is the high level of defense spending. He said the Defense Department pours $1,500 per capita into the Massachusetts economy, compared to just $200 a person in Iowa.

"I think it's unfortunate that he {Gephardt} is taking this approach," John Sasso, Dukakis' campaign manager, said. He added that Dukakis "will continue to campaign positively on what he believes is right for our country."

Mark Gearan, who runs Dukakis' Iowa campaign, said that only 7 percent of Massachusetts' gross product is defense-related and that only 4 percent to 5 percent of the state's jobs are tied to defense.

Gephardt and Dukakis are widely considered to be among leaders in the competition to win the Feb. 8 Iowa caucuses. These first tests of presidential strength can prove critically important to the campaign's outcome.

Issues cited by Gephardt in attacking Dukakis coincide extensively with findings from polls and focus groups of Democrats who attend Iowa meetings.

These studies, according to Gephardt aides and others working here, have indicated strong resentment of what many Democratic activists here see as a "bicoastal" economy in which the West and East coasts are benefiting under President Reagan, while Iowa and much of the Midwest have suffered.

Gephardt contended that defense-spending patterns are one of the reasons "we have a bicoastal economy."

In addition, Iowa Democrats tend to be sharply critical of high levels of defense spending under Reagan, just what Gephardt contends is a significant reason behind a Massachusetts economy with an unemployment rate well below the national average.

Gephardt specifically pointed to Massachusetts as a major recipient of spending on Reagan's Strategic Defense Initiative (SDI). Criticism of SDI consistently brings applause at Democratic gatherings here.

Gephardt is sponsoring trade legislation calling for retaliation against nations that fail to reduce trade surpluses with the United States and has disagreed sharply with Dukakis about trade policy.

At the Democratic candidates' debate in Houston Wednesday, Dukakis said retaliatory or restrictive trade policies would sacrifice American jobs, not protect them.