Poland's Army newspaper today denounced a former senior Foreign Ministry official as an American spy and called for a sweeping purge in all areas of Polish life.

The alleged spy was identified as Bogdan Walewski, who until last year worked as head of a Foreign Ministry department. Unofficial reports have circulated for some time about his arrest but today's report in Zolnierz Wolnosci was believed to be the first time that he had been officially accused of spying for the United States.

The newspaper commentary, signed by Col. Adam Rostowski, appeared to reflect hard-line opinion in the ruling military council, which contends that the present crackdown in Poland has not gone far enough. Rostowski warned of the possible appearance of what he called "a Trojan horse" in the state administration unless the "enemies of socialism" were smashed once and for all.

There are believed to be considerable differences of opinion within the Polish leadership over how soon to relax martial law, which was declared Dec. 13. Some officials in the reformist wing of the Communist Party have spoken out in favor of a political solution to the crisis and the reinstatement, albeit under strict control, of Solidarity, the independent trade union federation.

Rostowski, however, called for the purge of the government and news media to be broadened. He said it should include all officials and journalists who failed to oppose openly "the political enemy" during the past 16 months.

The newspaper cited Walewski and the former Polish ambassadors to the United States and Japan as proof of grave deficiencies in "the system of assigning personnel to responsible positions." The ambassadors, Romuald Spasowski and Zdzislaw Rurarz, asked for political asylum in the United States following the declaration of martial law.

Walewski, who had responsibility for personnel matters at the Foreign Ministry, is believed to have been arrested nine or 10 months ago. But the affair became public knowledge only recently when one of his immediate superiors, Deputy Foreign Minister Marian Dobrosielski, was dismissed, apparently for negligence.

The official announcement on Dobrosielski said he had resigned "to pursue his academic studies."

Today's commentary, one of the toughest that has appeared to date, said martial law created ideal conditions for "a real, effective and not merely superficial verification of personnel in the party, administrative apparatus, economy, press, radio, television, and several other branches of our life."

"This will entail checking thoroughly the political and ideological positions and the professional abilities of personnel," it said. "Those people who took two-sided positions during the period of intensified political struggle or held wait-and-see attitudes or openly spoke for the political enemy must be removed."

The paper said some Polish journalists had behaved as "chameleons" and some party and professional activists had done everything they could to curry favor among the "political opposition.

"These people thought that sitting astride the fence was their best guarantee of political and professional survival," it added.

A more moderate tone is being projected by the newly established government newspaper Rzespospolita, which has called for major economic and legislative reforms. The paper appears to have the backing of the leadership's moderate faction, headed by Deputy Premier Mieczyslaw Rakowski.

Political analysts here are waiting for a speech to parliament next week by Gen. Wojciech Jaruzelski, the martial-law chief and premier, to see what course the military authorities intend to take. Officials have said Jaruzelski will outline the government's future program in the speech.

The economic difficulties facing Poland were underlined today by newspaper reports of a shortage of essential supplies in key industries. The Lenin Shipyard in Gdansk, birthplace of Solidarity, was reported to have encountered significant problems.

The press also published a long list of factories that will not be allowed extra imports this year because of a shortage of hard currency.

Calls by Solidarity activists for passive resistance by workers in the form of "Italian strikes"--in which workers go through the motions of work without producing anything-- have further complicated efforts to increase production. A recent Solidarity leaflet said workers should remember that "our weapon against their tanks is the snail."