OTTAWA -- The Canadian military was privately furious the Harper government did not allow it to court-martial a naval intelligence officer who sold top-secret allied information to the Russians.

And the decision could well have far-reaching implications and potentially compound the damage done by former sub-lieutenant Jeffrey Delisle, says an intelligence expert who followed the case.

The 42-year-old Delisle was sentenced to 20 years in prison earlier this year after pleading guilty to selling classified Western intelligence to Russia during a four-year period which began in 2007.

He was arrested in January 2012 after the FBI tipped off the Canadian Security Intelligence Service, which after months of surveillance brought in the RCMP to build a criminal case.

The military was brought into the loop only after the investigation was well on its way towards a civilian prosecution.

"All senior government authorities involved in security and intelligence matters should be made aware of the alternatives available to pursue suspects subject to the Code of Service discipline, so that automatic defaults to mechanisms more applicable to civilians do not occur," said a newly declassified military assessment of the damage wrought by the spy scandal.

"Little or no discussion concerning the advantages of employing the military police to lead the criminal investigation, the (Canadian Forces National Counter-Intelligence Unit) to lead the counter-intelligence investigation and laying the charges under the Military Justice Systems appears to have occurred and/or fully informed decisions made with regard to the way ahead."

When someone joins the Forces, they are subject to a totally separate justice system while in uniform and on base. Infractions committed off-base can be dealt with in civilian courts, such as in the case of the sex murder charges against former air force colonel Russell Williams.

The rules for courts martial give the military wide latitude on what evidence is presented in public and what is kept secret.

It would have been in the country's best interest to prosecute Delisle by court martial because the public disclosure of details through the civilian system has laid bare weaknesses in the intelligence community, said Michel Juneau-Katsuya, a former CSIS agent.

"The public doesn't need to know all of the details," said Juneau-Katsuya, who also served with the RCMP.

"You must take into consideration whatever you reveal to the public, it will go to the bad guys, and the bad guys will be capable to be better next time, and that's the weakness of the procedures in civilian court."

Through the court process, the public learned of lapses in the system of security clearances and that top-secret defence computers were not as secure as the military believed.

Juneau-Katsuya said the government likely chose the civilian prosecution route because it didn't believe National Defence could carry out a competent investigation, among other things.

"I think we jumped the gun," said Juneau-Katsuya. "I have seen it often in my career. The civilian masters within National Defence don't necessarily trust military police and I think that was a mistake."

An expert in military law disagreed, however, saying the decision to prosecute the trouble naval intelligence officer under national security legislation was the right one.

"Thank God that this is exactly what happened here; otherwise, it would have created a bad precedent," said retired colonel and lawyer Michel Drapeau.

Allowing the military to investigate, prosecute and sentence one of its own for such a grave offence would have put the Forces in a conflict position and fostered lingering doubts about whether the procedure was fair.

"Therefore, it is arrogant and improper for the military brass in general, and the (Judge Advocate General) in particular, to oppose this reality and resist the notion of 'civilian control' over all judicial affairs in this country," Drapeau said.

There has been considerable public debate about how Delisle, a man with a failing marriage and money trouble, kept his top-secret clearance and managed to easily copy sensitive intelligence to a portable memory stick.

The review shows the military remained confident of its overall security approach in the aftermath of the scandal, but that improvements were required at bases in Canada.

Defence officials, writing in their review, said they believed Delisle's actions revealed several "deficiencies" in the security program. But many of those had already been pointed out to the department by its own chief of review services and the auditor general.