A Moroccan royal counselor assured the Reagan administration yesterday that his country's unity agreement with Libya will not affect Morocco's close ties with the United States, but U.S. officials said they remained concerned that Moroccan King Hassan's move toward Libya might be "a dangerous game."

The officials, who declined to be identified, said that a meeting between Secretary of State George P. Shultz and Reda Guedira had failed to clarify to U.S. satisfaction the extent and nature of the proposed union between Morocco and the radical, anti-American regime of Libyan leader Muammar Qaddafi.

Although Guedira reportedly explained Hassan's strategy as a move to make Qaddafi more responsible and bolster Morocco's position in North Africa, the officials said it runs counter to U.S. policy of isolating Qaddafi rather than legitimatizing him. As one official put it, "Despite Hassan's belief that he can control the process, we see this as a potentially dangerous game."

Of particular concern, the officials added, is the effect unification might have on close U.S.-Moroccan military cooperation. The United States has sent $58 million in military aid to Morocco this fiscal year and envisions sending $66 million during fiscal 1985. It would be impossible to continue such aid if there were any chance of U.S. weapons falling into the hands of what Washington regards as a renegade, terrorism-sponsoring country, the officials stressed.

The officials said the United States will reserve judgment until implementation of the unity accord, announced by Hassan and Qaddafi three weeks ago. This will give a clearer picture of how close the two countries become and how much influence Libya is able to exert on Morocco.

According to the officials, Guedira, who also will meet Vice President Bush today, argued that Hassan sees the unity agreement as a way to neutralize Qaddafi or at least to moderate his behavior. The officials said Guedira also conveyed Hassan's belief that he can control the unification process, all of which must be worked out by committees and approved by the king.

In addition, the officials continued, Guedira left little doubt that Hassan was influenced strongly by the desire to outflank Algeria, Tunisia, and Mauritania, the three neighboring countries that occupy the 2,000 miles separating Morocco from Libya.

These countries have opposed or failed to support Hassan's efforts to maintain Morocco's hold over the Western Sahara. Hassan has been battling a separatist challenge from guerrillas of the Polisario Front. In the past, Libya also has aided the Polisario guerrillas, and a Moroccan accord with Libya would force Qaddafi to stop supplying them with Soviet-bloc weapons.

Hassan has come close to staking the future of his monarchy on his ability to win the Western Sahara campaign, and U.S. officials think that was the main reason why he stunned the United States in mid-August by announcing that he had taken the initiative in proposing the unity agreement to Qaddafi.

On six earlier occasions, Qaddafi has tried unsuccessfully to unite Libya with another Arab state (twice with Egypt, twice with Sudan and once each with Tunisia and Syria). Some U.S. officials believe that the latest proposed union will suffer a similar fate because the gulf in outlook between the two governments is so great.

Nevertheless, initial U.S. attempts to minimize the unity accord have failed to disguise the nervousness the situation has caused in an administration that, as one official put it, "does not rank Qaddafi on its list of the 10 most popular national leaders."

In fact, the Reagan administration has gone to great lengths to prevent Libya from getting U.S. weapons or other equipment that might be used for terrorism by putting it on the State Department's list of countries supporting international terrorism. While the officials said it would take some time to sort out the various legal implications of the situation, a formal declaration of Libyan-Moroccan unity might make it legally impossible to continue providing aid to Morocco.

In addition to military aid, the United States provided Morocco with approximately $20 million in economic aid and $37.6 million in Food for Peace assistance during the present fiscal year. For fiscal 1985, the administration has proposed $35 million in economic assistance and $52.5 million in Food for Peace.