When Oliver L. North was a midshipman at the Naval Academy, one of his history instructors urged him and his classmates never to forget the oaths they would take to uphold the Constitution and to reject any notion that their moral values should waver with the times.

"It comes down to cliches," history professor William R. Corson, a decorated Marine Corps officer who left the service in a dispute over its Vietnam policy, said. "Honesty is not the best policy -- it is the only policy."

Last week, after Marine Lt. Col. North had ended testimony before the Iran-contra committees, Corson, now national affairs editor for Penthouse magazine, passed judgment on his former student: "Oliver North got everything I was trying to teach him wrong."

Not all military officers share Corson's view. But a number of senior retired officers, including two who held top intelligence positions, said in interviews last week that they were troubled by the spectacle of two of the president's most trusted military aides testifying that they had lied and saw nothing wrong with actions that appeared to have violated various laws.

Some members of the congressional panel charged that statements of the two former National Security Council aides contradicted rules prohibiting officers from lying, their oaths to uphold the laws and the Midshipman's Code of Conduct. The code reads: "A midshipman will not lie, cheat or steal or tolerate those who do."

"I don't believe there is any excuse for lying inside our government," said retired admiral Stansfield Turner, a Naval Academy graduate who headed the Central Intelligence Agency during the Carter administration.

Turner, who declined to comment on the testimony of "my good friend," Rear Adm. John M. Poindexter, is the most critical of the 10 senior officers interviewed. "The norm has to be you don't lie, you don't shred documents and you don't take money," he said.

"We're taught at every step along the way to uphold the Constitution and the laws of the United States," said retired admiral Bobby Ray Inman, who held high intelligence positions in the Ford, Carter and Reagan administrations. " . . . No assignment as an action officer can subjugate that."

Other retired military leaders said, however, that the North and Poindexter testimonies persuaded them that the two had acted properly and that the usual military rules of conduct did not apply to their White House jobs.

"It is important when you get into questions of what is lawful and what is not to remember that the two positions are not military positions," said retired admiral Thomas H. Moorer, a chairman of the Joint Chiefs of Staff during the Vietnam conflict.

Moorer, an aviator who commanded both the Pacific and Atlantic fleets, said the Communist threat in Central America is so strong that North and Poindexter were, in fact, upholding their oaths to defend the country by actions helping the contras.

"If I thought it was vital to the defense of the country, I would lie," the admiral said.

"Personally I wouldn't lie, but the job required him to lie," said retired admiral William P. Mack of Annapolis, a former head of the Navy's congressional liaison office and academy superintendent. Mack said he draws a distinction between "lying for yourself and lying for the government," but said he is "very much concerned" that the public might not see the difference.

Turner and Inman, however, said they see the issue differently. "There is no excuse for lying," Turner said.

Inman said an officer has an obligation to question a superior who gives an order that might be improper. If his arguments are rejected, Inman said, the junior officer has three choices: "resign, request reassignment or retire."

Moorer said that is not practical for an officer in Washington because "you can bet your bottom dollar, you will be replaced by someone who will do what you didn't."

The admiral said he had reservations about the way the United States fought the Vietnam war, but that he did not resign because he wanted to do something that might help free the U.S. prisoners being held in North Vietnam.

Inman acknowleged that jobs outside the military can place an officer under political pressure, but said he was offended by some of the implications of the aides' testimony.

"I have a very strongly held view that this is a nation of laws," Inman said. " . . . And I have a concern that the image has been conveyed that national security issues cannot be dealt with within the law. I just don't believe that."

Inman, who held top positions in the CIA, Defense Intelligence Agency and the National Security Agency, said he had seen many larger covert operations win approval of Congress and be executed without the turmoil that North and Poindexter helped cause.

"If you are prepared to work hard, you can make them work," Inman said. "It's easier to ignore the system and do it your own way."

Almost all the retired officers agree that those assigned jobs outside the Defense Department face different pressures than those within the typical chain of command, situations that can confront military officers with new ethical questions.

"He's playing in a field where he has an insufficent background," said retired rear admiral Earl Preston (Buddy) Yates of Virginia Beach.

"You have to understand the military mind," said retired admiral George E.R. (Gus) Kinnear, now a Grumman Corp. official in Washington. "Military people would tend to take a job with the assumption that, if the military has assigned me to the job, then the system is saying, 'There is a job to be done and you are capable of doing the job.' So as military man, you go in there, put your head down and do it."

The military officer, said retired Atlantic Fleet commander Wesley L. McDonald, knows that when given an order, "By God, you salute and you go do it."

"I suspect, knowing John {Poindexter}, that it never occurred to him to question" whether his actions were proper, Kinnear said.

"Adm. Poindexter, whom I know personally, is a classic example of a military officer who lives by the concept of duty, honor, country," said former chief of naval operations Elmo R. (Bud) Zumwalt. He was one one of the officers who said he was not convinced the Boland Amendment, the act prohibiting any intelligence agency from helping the contras, applied to the aides. Zumwalt said he believes the Code of Military Conduct applies to all officers, but he said "the concept has to be reinterpreted" when an officer moves into such a political arena as Poindexter and North.

To many retired officers, the hearings have been bittersweet. They expressed delight at the public support North seemed to have brought to the contras and the threat of a socialist government in Central America, but admitted to be worried by the debate over the proper role of a military officer, a role that most say members of the panel have overstated.

Despite his support for the cause championed by North and Poindexter, Moorer said he is concerned by Poindexter's failure to tell President Reagan what he was doing. "The main thing you're taught {at Annapolis} is you must keep your boss informed," Moorer said.