The U.S. Court of Military Appeals held yesterday that Air Force Lt. Christopher M. Cooke could not be court-martialed on espionage charges because of "prosecutorial misconduct" by the Strategic Air Command.

In a 2-to-1 decision, the court ordered prompt dismissal of all charges and specifications brought against Cooke last year for allegedly passing secret and top-secret information about the Titan II missile to Soviet diplomats here.

Cooke, 26, a Titan II missile crew commander, confessed to Air Force investigators last May, but only after they had promised him "no prosecution" in return for a full account of what he had done.

The Air Force then proceeded to court-martial him anyway, on grounds that the promises had not been properly authorized by the head of the Strategic Air Command and were simply the "result of a misunderstanding" between SAC and agents of the Air Force Office of Special Investigations.

The court majority rejected that view in a crisply worded decision holding that "basic constitutional law . . . , basic military law and basic military justice" had been overlooked.

The 12-page opinion, written by Judge Albert Fletcher Jr., constituted a sharp reprimand of SAC's top legal officer, Brig. Gen. C. Claude Teagarden, for falling short of "accepted standards of performance," and of SAC's since-retired commander, general Richard H. Ellis, for "the unfairness of his conduct in bringing petitioner to court martial."

By midday, the Air Force informed Cooke's lawyers that it was accepting an application he made May 12 for an administrative discharge "under other than honorable conditions." According to his chief defense counsel, F. Lee Bailey, Cooke was released from confinement at Fort Meade, Md., and was on his way home to Richmond a few hours later.

Yesterday's ruling cannot be appealed under military law, although the Air Force could ask for reconsideration. In a concurring opinion, Chief Judge Robinson Everett held open the possibility that Cooke might face civilian prosecution, but that seems unlikely.

"The Justice Department had already let it be known to me months ago that it had no intention of prosecuting him because it was such a screwed-up case," Bailey said.

"The promise Cooke got was not just a promise of 'no court martial,' it was a promise of 'no prosecution,' " added one of Cooke's military lawyers, Air Force Capt. J. Laurens Tullock. "The facts have not changed."

The court recognized the gravity of the charges against Cooke, but said that was no excuse for violating his constitutional rights. "Moreover," the ruling emphasized, "an accused's right to due process may not be suspended in the public interest unless in time of a rebellion or invasion. This is basic constitutional law."

The court also said "basic military law" made it the duty of a military court to protect those rights and that "basic military justice" made it the responsibility of the head of a military command and his staff judge advocate to comply with the Constitution and the Uniform Code of Military Justice in fulfilling their prosecutorial roles.

By contrast, Teagarden, the court found, "created a reasonable expectation" on Cooke's part that he would not be court-martialed if he cooperated with OSI investigators, and then remained silent when Cooke started talking. "Such tactics were indeed successful in producing for the Strategic Air command a verified account of the compromised national security information," the majority ruling stated.

"We believe, however, that although any accused may have to make many difficult decisions, . . . he need not gamble on the integrity of prosecutorial authorities in the military justice system."

As for Ellis, the court said it found no excuse for his remaining silent even after he was briefed by his deputy May 17 "on the problem concerning the . . . grant of immunity" to Cooke.

"Such conduct by a commanding general . . . was in violation of the orderly prosecutorial procedures" prescribed by the military justice code, the court said.

The majority ruling also contained sharp words for the trial judge in the case, Air Force Lt. Col. David Orser, who ruled in the Air Force's favor last in September.

Relying heavily on a paragraph in the Manual for Courts Martial, Orser held that Cooke's confession was tainted, but said he could still be court-martialed because the promise of immunity had not been properly authorized.

The majority said Orser still had a duty to afford Cooke "due process of law."