In a rare public airing of his views on Greece, U.S. Ambassador Monteagle Stearns has criticized the anti-Americanism of the three-year-old Greek Socialist government and warned that the United States likes to bestow its friendship only on countries that reciprocate it.

Stearns is a career diplomat who took up the Athens post at the time of the 1981 Socialist election victory with a reputation of being a supporter of Greece and a personal friend of former Berkeley economics professor and current Prime Minister Andreas Papandreou. He has run a very tight-lipped embassy through the last three years' downhill slide in Greek-U.S. relations.

Though relatively mild by the standards of Washington, where Reagan administration officials often openly express their dislike of Papandreou's brand of socialism, Stearns' luncheon speech Tuesday to journalists, politicians, diplomats and businessmen marked a departure from his usual reserve. The ambassador has often told foreign correspondents here that he feels the job of talking to the Greek Socialists, difficult as it is, preferably should not be complicated further by conducting the dialogue through the press.

Stearns pegged his critique Tuesday to the annual Nov. 17 protest march on the American Embassy, established as a major political event by the Papandreou government, to commemorate the 1973 uprising by Athens Polytechnic students against the 1966-1974 military dictatorship.

Greeks of all political persuasions blame the United States for supporting, if not actually installing, the military junta. The Polytechnic march has become the occasion for venting anger against Washington.

Each year for the past three years hundreds of thousands of Greeks -- including, last year, the prime minister's American wife, Margaret Papandreou -- have filed past the fortress-like embassy building in central Athens chanting, "Americans, murderers of nations," "The people don't want you; take your bases and go," and similar slogans.

This year's Polytechnic commemoration "was a celebration of the Greek people's sacrifice to restore democracy," Stearns said in a speech peppered with Homeric allusions. "The only aspect of that celebration that seemed to me irrelevant to the occasion and unworthy of it was its ending in front of the American Embassy. It showed how much misunderstanding of the United States, willful or not, still exists in the rest of the world," he said.

Comparing the United States to Ithaca, which was not immediately recognized by Odysseus after his return, Stearns voiced a pointed defense of American society, which he called "nonmilitaristic" and "a working model in a world full of models that don't. We wear our motives on our sleeves and carry our purposes like banners. In our foreign policy, you get what you see," said Stearns, who is known to feel privately that Athens is less than straightforward in its foreign policy commitments.

"We do not assume that because a nation takes a different route it is hostile to our interests. But we do not wish to impose our friendship on those who do not reciprocate it and we will not withhold our friendship from those who do," he continued.

Observers saw Stearns' praise of the American way as clearly aimed at Papandreou's past criticisms of the United States, which he has compared unfavorably with the Soviet Union as an international expansionist and imperialist power. It was just such a critique, delivered at the Panhellenic Socialist Movement congress in May, which proved to be the straw that broke the back of Washington's patience with the Papandreou government's anti-Americanism.

This patience had already been strained by the Greek refusal to go along with western sanctions against Poland after the imposition of martial law there in 1981, the refusal to condemn the Soviet Union for the shooting down of a South Korean airliner in 1983, and Papandreou's official commitment to the international peace movement and to the setting up of a nuclear-free zone in the Balkans.

Stearns' term in Greece has included two successes not achieved under previous ambassadors working with much more sympathetic conservative administrations -- the signing of a new Greek-U.S. defense and economic cooperation agreement ensuring the operation of the four American military bases here at least until 1989, and this month's Greek decision to buy 40 U.S.-made F16 aircraft to modernize its Air Force.

The signing of the bases agreement in particular led the Athens Embassy for a long time to suggest that Papandreou's anti-Americanism was only skin deep and directed mainly at the domestic gallery of the opposition Communist party, which is powerful in the trade unions, and Socialist party hard-liners.

But the shock of the May party congress speech has now prompted both the embassy and Washington to take a longer, harder look at Papandreou's ideological commitment and his ultimate plans for Greece.

The prime minister often has said that disengaging Greece from the western strategic camp requires cautious handling if it is not to endanger the country. Athens is acutely aware of its NATO rival and historic enemy Turkey, with which it finds itself forced to compete -- lacking an alternative supplier -- for arms and military credits from the United States.

"We do not want a confrontation with the United States. We are too small," Papandreou characteristically told the large circulation Athens daily Ta Nea in an interview published Monday. In the same interview, Papandreou linked the United States with the military dictatorship in Greece and said his country was no longer prepared to be "the satellite" it was in the period after World War II.

"The message that must get through to the United States is that Greece is an independent country. When it does, our relations will improve very much," he said.