Of the world's national leaders, none knows the United States better than Greek Prime Minister Andreas Papandreou, who spent almost 20 of his 65 years living and working here as a highly respected professor of economics.

Yet, in the three years that his Socialist government has held power in Athens, Papandreou has described the United States as an expansionist and imperialist power, courted Libyan leader Muammar Qaddafi and charged that the Korean Air Lines jetliner shot down by the Soviet Union last year with the loss of 269 lives was a spy plane working for the United States.

U.S. officials regard Papandreou's attitude as more appropriate to the communist bloc or the Third World than to a country the United States regards as a traditional friend and ally.

Because the United States and its European allies believe it is crucial for Greece to remain anchored firmly in the West European mainstream, the Reagan administration initially sought to work with Papandreou while suffering his criticisms of U.S. policy in relative silence. More recently, however, the administration decided that it would no longer turn the other cheek, and it has reacted in ways that Greek officials charge are a deliberate attempt to penalize Papandreou for his outspoken independence.

"No one wants bad U.S.-Greek relations," said a senior U.S. official, who asked not to be identified. "But we are going to react when we are subjected to what we regard as unfair or misleading criticism. We are going to set the record straight."

The shift to a new U.S. approach began last May when Papandreou, in a speech to his Panhellenic Socialist Movement, delivered a lengthy critique of the United States and compared the Reagan administration unfavorably with the Soviet Union.

Official U.S. irritation at his remarks was compounded by subsequent incidents such as Greece's release of a suspected Jordanian terrorist despite U.S. evidence linking him to planned terrorist acts.

Such attitudes are especially galling to U.S. officials who feel that Papandreou, with his long experience in the United States, knows better. After earning a doctorate in economics at Harvard in 1943, he taught at several American universities and was chairman of the economics faculty at the University of California at Berkeley before returning to Greece in 1960 when his late father, George Papandreou, was prime minister.

After Andreas Papandreou won the prime minister's post in October 1981, the United States initially took a policy tack toward him unofficially described within the State Department as "Watch what he does, not what he says."

Department officials argued that domestic political considerations obliged Papandreou to make occasional bows toward the militantly anti-American elements that are an important force in his party. But, the argument continued, his smoking oratory disguised the fact that he was working quietly with Washington to achieve some sensitive agreements that had eluded earlier Greek governments more openly sympathetic to the United States.

The most important was the signing of a U.S.-Greek defense and economic accord ensuring continued operation of the four U.S. military bases in Greece at least until 1989. Last month, the Papandreou government also ended years of indecision about how to modernize the Greek air force by deciding to buy 40 U.S.-made F16 jet fighters.

But, despite these successes, the shock waves from Papandreou's May speech to his party congress prompted U.S. officials to reassess their policy of trying to step gingerly around his attacks. As the senior U.S. official put it:

"There are limits to how much you can let them get away with. If you keep turning a blind eye each time they distort the record, you encourage more of that kind of behavior. After a while, the rhetoric merges with reality to the point where they are dug into positions that can't be changed and that could lead to a real crisis in our relationship."

In keeping with that approach, the Reagan administration last summer decided to give surplus F5 aircraft to Turkey rather than to Greece, and the U.S. ambassador in Athens, Monteagle Stearns, who is a friend of Papandreou, recently made a much-noted speech pointing out that when the United States treats a country as a friend, it deserves some reciprocity.

Papandreou's attitudes toward the United States generally are regarded as governed by several considerations. One is the need of the United States, as leader of the North Atlantic Treaty Organization, simultaneously to seek good relations with Greece and Turkey, both NATO members of strategic importance.

Given the historically bitter animosities between Athens and Ankara over Cyprus and other issues, that puts Washington in what U.S. officials concede is "a perennial no-win situation." Although both countries receive substantial U.S. military aid, each accuses the United States of favoring the other.

A second factor is lingering bitterness in Greece over the close U.S. relationship with the rightist military junta that ousted Papandreou's father and ruled the country with a repressive hand from 1966 to 1974. Andreas Papandreou was persecuted by the junta, and he is thought to have never forgiven the United States for what many Greeks believe was covert U.S. encouragement of the coup.

Also, said the senior U.S. official, "For the present, the Papandreou government has been playing the maverick role. It wants the advantages of membership in NATO and the European Economic Community, but it frequently is a disruptive partner in both, insisting on pushing its parochial concerns to the exclusion of the larger interest and advocating ideological attitudes that are clearly outside the western strategic consensus."

The official continued: "The Greek explanation is that they are acting as an interlocutor between the West and the nonaligned world. But some of their positions can't be squared with what NATO collectively believes is in its interest. It's not possible to keep one foot in a strategic alliance and one foot in the nonaligned camp. Sooner or later, Greece must opt out of one or the other."