The former second-ranking Marine assigned to guard the U.S. Embassy in Moscow has been ordered to face a court-martial on charges he had sex with Soviet women and failed to report his liaisons, a violation of the embassy's fraternization rules.

Marine Corps officials announced yesterday that Staff Sgt. Robert S. Stufflebeam, 24, of Bloomington, Ill., was charged with nine violations of the Uniform Code of Military Justice. He is the second Marine to be ordered tried on charges growing out of a sex-for-secrets investigation that high government officials have said caused a serious security breach at the Moscow embassy.

Stufflebeam has never been accused of espionage. The corps has had to reduce or drop espionage charges against two other Marines formerly stationed at the embassy.

Earlier this week members of Stufflebeam's family told reporters that they had been informed that the case, under review by a general at the Quantico Marine Base, would be ordered to trial.

Lee Stufflebeam, a Norfolk real estate salesman, said yesterday that his nephew will plead not guilty. "We fully expected this," Lee Stufflebeam said. "The Marines have got to do something to save face."

He said the corps was embarrassed last week after it was unable to press the most serious charges in the case against the first two Marines who were publicly implicated -- Sgt. Clayton J. Lonetree of St. Paul, Minn., and Cpl. Arnold Bracy of the Queens borough of New York.

Charges that the two Marines allowed Soviet intelligence agents into the embassy's communications rooms were dropped by military authorities, who said they have been unable to corroborate Bracy's earlier statement that the two allowed the agents to enter the embassy.

Lonetree, 25, will be tried on other espionage charges at Quantico beginning July 22. If convicted, he could be sentenced to life in prison.

Stufflebeam could face up to 14 1/2 years in prison, a dishonorable discharge and loss of all pay and allowances if convicted of the charges. In the formal charges, he is accused of having sex with Soviet women and failing to report these contacts in violation of the ban on fraternization with Soviets.

Specifically, Stufflebeam is charged with meeting unnamed women at Moscow hotels and, in one case, "accompanying this Soviet woman to her apartment where he had sexual intercourse with her -- the aforementioned contacts not having occurred in the line of duty."

Stufflebeam served a one-year tour in Moscow that ended in May 1986.

No date has been set for his court-martial, but his uncle said the lawyers the family has hired will fight the allegations with various pretrial motions, including claims of selective prosecution.

Defense lawyers have said that the Marine Corps is moving administratively against 18 other former Moscow guards and have elected to prosecute only Stufflebeam on fraternization charges.

A Marine spokesman said that he could not confirm whether 18 others are facing administrative proceedings at Quantico. All the former Moscow Marine guards have been stationed there during an inquiry into what happened at the embassy.