MANAGUA, NICARAGUA -- Nearly two months after he shocked Nicaragua by defecting to the United States, Roger Miranda Bengoechea remains a mystery to his former colleagues and a source of rancor and bewilderment to the Sandinista leaders he betrayed.

The Sandinista Army major, who rose to a key position as a top aide to Defense Minister Humberto Ortega after distinguishing himself in the 1979 revolution, is now the target of a Sandinista effort to undermine his credibility and sully his image. The effort is considered likely to be taken up by Sandinista supporters in the United States, as the Reagan administration parades Miranda as part of its own media campaign against the Managua government.

Among the allegations emerging against Miranda here are that he was involved in summary executions of Sandinista opponents shortly after the July 1979 revolution that overthrew dictator Anastasio Somoza and that he ordered the killing of a National Guard colonel who had surrendered. The executions have been acknowledged by the Sandinistas, but Miranda's role in them is in dispute.

A military counterintelligence team has gone over the Miranda case in detail, unearthing information about his past and trying to figure out what went wrong, a Sandinista official said. The investigation appears to have focused largely on the question of whether Miranda had been a CIA mole before his defection Oct. 25, a question still unresolved in the minds of his former colleagues, the official indicated.

Miranda has denied that he worked for the CIA before defecting in Mexico City.

In an effort to assess the damage, the counterintelligence team also has studied sensitive military documents that Miranda copied and took with him, the official said. But damage-control efforts so far seem to be focused on questioning Miranda's reliability and motives.

"He had the soul of a traitor; he even has the background of that," said Maj. Rosa Pasos, the Defense Ministry spokeswoman. "He had a very strange personality."

Her account of Miranda's background indicated that the Sandinista leadership cannot accept his stated reason for leaving: that he became disillusioned with Sandinista rule, corruption among top officials and the rationale of the war against the Nicaraguan rebels known as contras. Pasos said she thought Miranda was highly ambitious and "developed a feeling against Gen. Ortega."

Pasos described Miranda as "very mechanical," "rigid" and "lacking human and fraternal relations" with other people. But she said Defense Minister Ortega, the country's only full general and the brother of President Daniel Ortega, "thought Miranda was a person he needed" because he was "very straight, very firm and without liberal thoughts." She added, "He followed orders. He was very efficient, but not very creative. He didn't have brilliant ideas."

According to Pasos and independent sources, Miranda, a son of a wealthy land-owning family from Granada, studied in Chile during the leftist government of Salvador Allende. Shortly after the military coup that overthrew Allende in 1973, Miranda was shot and wounded in the groin area by a Chilean soldier during a raid against suspected student leftists. Later, Miranda went to Mexico for medical treatment of hip and bladder problems.

To this day, Pasos said, "The Sandinista Front doesn't know what Miranda really did in Chile." She said that after the Sandinistas took power, he went to Mexico periodically "because he said he wanted the same doctor to see him." Miranda told reporters in Washington he has a hip prosthesis that has to be checked regularly by the doctors in Mexico.

Although Sandinista authorities did not question the trips at the time, Pasos said, investigators now wonder whether Miranda had other motives.

Miranda returned to Nicaragua in 1977 and joined the Sandinista National Liberation Front, which was recruiting heavily at the time, Pasos said. He rose to become second in command in the city of Masaya by 1979, gaining fame as a guerrilla fighter.

"That's where we put confidence in him," Pasos said.

After the Sandinistas took power, Miranda "stayed in Granada and involved himself in the killing of a lot of Somoza guardsmen," Pasos said. She charged that he "ordered the killing of the National Guard commander of Granada," Col. Coronado Urbina, for personal reasons.

A Sandinista commission later went to Granada to investigate, found the situation in disorder and "told everyone to stop everything," Pasos said. The Sandinistas in Granada were transferred out, and Miranda was temporarily out of a job, she said.

"We concluded that he was tired as a consequence of the war," she said. Miranda later served briefly in the Sandinista intelligence service, then became assistant to the deputy defense minister and, finally, the defense minister's chief staff officer, Pasos said.

There was no indication that Miranda was ever punished or reprimanded for his alleged role in the Granada killings, and his involvement is disputed by other sources. The widow of Col. Urbina has told a reporter that she does not blame Miranda for the murder of her husband. She has said that after the revolution, Miranda, a friend of the Urbina family, got her husband out of jail to be taken to Managua, but turned him over to Sandinistas in Granada for reasons that are unclear.

Urbina's body has never been recovered.

According to a U.S. State Department account based on reporting by the opposition Permanent Commission on Human Rights in Managua shortly after the killings, Sandinista officials under the command of Reinerio Ordonez Padilla "summarily executed" more than 80 persons in Granada in the final weeks of July 1979 and buried them secretly. The account said Ordonez was arrested after human rights organizations denounced the killings, but was detained only two weeks.

The Defense Ministry has called Miranda "emotionally disturbed." But Pasos' account indicated that Miranda's former colleagues still wonder what made him defect.

"If you're disillusioned with where you're working, why do you go and sell yourself to the devil?" Pasos asked.

"He'll be a traitor for the CIA, too," she said. "If I were the CIA, I wouldn't trust him because traitors are traitors always."