The recently resigned U.S ambassador to Algeria sharply criticized the Reagan administration yesterday for announcing a large tank sale to Morocco only two days after Algeria -- Morocco's North African neighbor and often bitter rival -- played a major role in gaining release of the American hostages in Iran.

In testimony before the House committee, former ambassador Ulric Haynes seemed to suggest that the timing was deliberately calculated to make clear to Algeria that it could not expect more favorable treatment from the United States because of its help in winning freedom for the hostages. This fit in with a broad tilt, under the Carter administration as well as the new Reagan team, toward Morocco and against Algeria in their dispute over the Western Sahara, he said.

The message that Washington was ready to sell 108 M60 tanks to Morocco was the first diplomatic contact between President Reagan's incoming administration, he said, and the first at all between the two nations since the American hostages stopped over in Algiers on their way out of Iran after long, arduous negotiations in which Algerian diplomats played key roles as mediators.

"No one was more surprised than I to receive instructions from the State Department within 48 hours of the liberation of the hostages to inform the Algerian government that we were about to begin delivery of M60 tanks and OV10 counterinsurgency aircraft to Morocco," Haynes, a political appointee of the Carter administration, said before a combined panel of two House Foreign Affairs subcommittees. "The full significance of the action has yet to be adequately explained to me."

Haynes served as ambassador to Algeria for three years and seven months under the Carter administration, occasionally expressing disagreement with U.S. policy that he said slighted Algeria in favor of Morocco despite Washington's declared neutrality in the Sahara conflict. He resigned soon after the hostage release and has yet to be replaced.