Poland ordered the Warsaw bureau of United Press International closed today in retaliation for the expulsion from Washington last month of a correspondent of the Polish press agency PAP.

A Foreign Ministry official advised the American news agency that its bureau here could reopen when the PAP office in Washington resumes operations and when a new UPI correspondent is accredited to replace Ruth Gruber, the American reporter who was deported by the Polish government last month. It was Gruber's expulsion that triggered the U.S. order against PAP.

The bureau closure marks further deterioration in what little remains of official Polish-U.S. relations.

Angered by the continuation of Washington's economic sanctions against Poland after the suspension of martial-law restrictions in December, the government of Gen. Wojciech Jaruzelski also has interrupted cooperation with the U.S. Information Agency, which runs a library in Warsaw and has arranged cultural, educational and scientific exchanges.

The Warsaw labor office is refusing to extend the work permits of a number of Poles who assist Western news organizations or who work at the U.S. Embassy.

Gruber, who had worked several years in Warsaw, was expelled Jan. 12 in what Polish authorities have conceded was a calculated effort to intimidate other Western correspondents. She was charged with overstepping the journalistic bounds of a foreign correspondent after police intercepted a package of photographs said by the government to have shown military installations in Poland.

The package had been sent to Gruber by train from the northern port city of Gdansk. But Gruber denied specific knowledge of the pictures or the identity of the sender, who remains a mystery.

At the time, government spokesman Jerzy Urban termed the expulsion a warning to other Western correspondents to avoid contacts with "criminal circles"--a reference that was understood to include leaders of the outlawed Solidarity trade union who are still in hiding.

Announcing the UPI closure, the Foreign Ministry this morning summoned Bogdan Turek, a Pole who has been accredited with UPI in Warsaw for 12 years and has been heading the bureau since Gruber left. A ministry official read Turek a statement explaining that the office was being shut in retaliation for the ousting Jan. 18 of PAP's correspondent, Stanislaw Glabinski.

Because Glabinski had been the only PAP correspondent in Washington, his deportation, the official said, had forced the office to close, whereas UPI's office in Warsaw, which had an accredited staff of two, had been able to remain open. The decision to close UPI, said the official, was intended to give "equal treatment" to both the Polish and American news agencies.

Asked at a press conference last week when PAP would be sending a replacement to Washington, the agency's editor in chief, Janusz Roszkowski, said it would be difficult now to find someone willing to take the job in view of what he said would be the constant threat of expulsion by the Reagan administration.

In the past, a posting to Washington has been a highly coveted assignment among Polish journalists.