The State Department yesterday ordered an Afghan diplomat to leave the United States in retaliation for the expulsion of an American diplomat from Afghanistan last week.

The U.S. diplomat, second secretary Peter Graham, was notified Saturday of his expulsion from Kabul on charges, described by the State Department as "ludicrous and wholly without foundation," of trying to trade pornographic literature for rugs.

State Department officials said the expulsion of Graham, one of the three or four top U.S. diplomats in Kabul, was completely unexpected and lacked clear explanation.

"We don't have any clue what it is about," an official said.

Graham had been planning to leave Kabul at the completion of his tour of duty late this month, a fact known to the Afghan government, officials said.

In retaliation for the expulsion, the State Department notified the Afghan Embassy here that second secretary Masjedi Hewadmal "is no longer acceptable to the U.S. government." Hewadmal was given 48 hours to leave, the same period of time accorded to Graham in Kabul, according to department spokesman Alan Romberg.

Romberg also said the State Department is "puzzled and concerned" by recent arrests of white-collar Afghan employes of the embassy by the Afghan secret police. Eighteen such employes, nearly the entire white-collar staff, have been arrested or have disappeared, officials said.

Officials said several other recent actions, including refusal to renew visas for Indian and Pakistani employes of the embassy, had made U.S. diplomatic activities in Kabul more difficult. This had led to speculation that the Afghan government may be moving to reduce further or close the U.S. mission in Kabul.

American diplomats in Kabul have been told to deal with administrative and consular activities only and to avoid political dealings that could imply U.S. acceptance of the Soviet-backed Afghan regime.