The Carter administration has approved the sale of six heavy-lift Chinook military helicopters to Morocco despite a continuing dispute with the government of King Hassan II over the use of American-supplied military goods, U.S. officials said yesterday.

The decision is a one-time exception to the administration's policy of refusing to provide arms to Morocco as long as the Moroccans fail to pledge formally that they will not use the weapons in the guerrilla war in the Western Sahara, the officials said.

The decision was made last week after a six-month review that provoked a sharp diplomatic note from Morocco to the State Department that implicitly questioned the administration's willingness to live up to commitments to its main allies abroad, diplomatic sources confirmed this week.

According to one non-diplomatic source, Hassan personally ordered his embassy in Washington to write a strong letter to Secretary of State Cyrus Vance after being told of increasing deliveries of Soviet and other weapons to Libya and Algeria, Morocco's arch-rivals in northern Africa.

Hassan has been a key figure in Middle East peace efforts and is closely allied to Saudi Arabia's royal family. He has repeatedly offered to take on an expanded security role in Africa if asked, and supported, by the West.

The Moroccan letter, which U.S. officials said arrived after the decision was made on the Chinook sale, strongly suggested that recent U.S. actions abroad were causing Morocco and other states to rethink their own national security policies.

Seeking "clarification" of U.S. foreign policy, the letter asserted that "reassurances can be best demonstrated to Morocco and other allies by a clear and consistent policy," according to one account, which could not be officially confirmed.

Hassan is known to have been shaken by what he sees as the failure of the administration to act decisively to save the shah of Iran and to prevent the spread of Soviet influence in Afghanistan, the Horn of Africa and elsewhere.

Shah Mohammad Reza Pahlavi is currently in the southern Moroccan city of Marrakech as Hassan's guest. Diplomatic sources report that the shah, embittered by what he also feels was a lack of U.S. support at cruical moments, has decided not to go to the United States for the time being and will stay instead in the Middle East.

The dispute over U.S. arms deliveries grows out of a still secret 1960 agreement with Morocco, and from Morocco's 1976 annexation of the northern part of the former Spanish Sahara colony.

Under the 1960 agreement, U.S. arms sold to Morocco can be used only for internal defense. The clause was reportedly intended by the United States to prevent Morocco from using U.S. weapons in an Arab-Israeli war.

Morocco considers the Sahara territory as part of Morocco, and adamantly refuses to promise not to use U.S. weapons in the Sahara in its continuing guerrilla war against the Polisario movement, which is backed by Algeria. The United Nations and the African Organization of Unity have not recognized the Moroccan claim of sovereignty.

As a result, the State Department for more than a year has refused export licenses for a $100 million arms package that includes reconnaisance aircraft and helicopter gunships.

The decision to allow an Italian manufacturer operating under a license from Boeing to ship six CH-47 helicopters to Morocco was made on the basis of "special circumstances," a U.S. official said, and "is not a precedent for any other sales."

The contract for the Chinooks, which were extensively used by U.S. forces in Vietnam to ferry heavy cargo, was signed in December 1977, before the administration had made a firm decision on holding up military deliveries that could be used in the Sahara, the official said.