Trevor Kloschinsky was charged with first-degree murder in the death of Rod Lazenby.
But Queen's Bench Justice Beth Hughes ruled that Kloschinsky, 49, did not realize that what he was doing was wrong.
"Wrong means morally wrong judged by the everyday standard of the ordinary person. It does not mean legally wrong," she read Thursday from her decision.
"I find the evidence establishes that it was more likely than not that Mr. Kloschinsky's mental disorder made him incapable at the time he caused the death of Mr. Lazenby of knowing the act was wrong."
Doctors testified at Kloschinsky's trial that they found him "actively psychotic."
Hughes pointed to a report done by Dr. Sergio Santana, a forensic psychiatrist, who said Kloschinsky suggested to him that it was his right to defend his property against a thief, enforce the law and make a citizen's arrest.
"Mr. Kloschinsky's thinking processes were as affected by his delusional thinking as to prevent him from realizing that assaulting officer Lazenby was wrong," Hughes quoted from Santana's report.
Lazenby's family reacted with disappointment.
"I wasn't surprised. We had half known it was going this way," said Lazenby's daughter, Meghan McLean, who was surrounded by several relatives who sat through the three-day trial.
"I do not feel justice has been served for my father, our family member, peace officer Rod Lazenby."
Lazenby, 62, died in August 2012 after going to Kloschinsky's rural property near Priddis, south of Calgary, to investigate an animal complaint. Lazenby was a retired RCMP officer who was responsible for enforcing bylaws in the Municipal District of Foothills.
McLean said the family is unhappy that Kloschinsky is to be held at a mental hospital and subjected to annual reviews instead of being sentenced to time in prison.
"How do we explain to Rod's grandchildren that someone on paper admitted to killing Rod, but at the same time is not responsible for the crime?" she asked as she choked back tears.
"This ruling does truly not allow the family to move on to a new level of healing, as the annual review will make us have to relive this tragic loss."
Santana told court during the trial that Kloschinsky has been on anti-psychotic drugs and is "much better now,'' although he continues to be delusional. However, the symptoms are less frequent and not as intense.
An autopsy found Lazenby was strangled and had 56 abrasions, contusions and lacerations to the face, head, neck, body and back. He also suffered numerous internal injuries.
Kloschinsky admitted he caused Lazenby's death. He acknowledged dropping the officer off, handcuffed and unconscious, at a southeast Calgary police station, where he told officers he had apprehended a "dog thief."
Kloschinsky eked out a living selling blue heeler dogs he raised on his property. Court heard how he thought Lazenby was corrupt and trying to steal his animals.
Lazenby was an RCMP officer for 35 years and often worked undercover in Vancouver. He once bunked with child killer Clifford Olson and went after dangerous drug dealers on Vancouver's skid row. Lazenby joined the drug squad after he served as a military policeman.
He had retired in 2006 and moved to High River, Alta., to be closer to his daughter and her children.
His brother, Bryan Lazenby, said he doesn't believe the family's voice was heard in the case.
"Victim's voices are rarely heard," he said.
Crown prosecutor Jim Sawa offered his condolences to Lazenby's family. He said the case "highlights the difficult job" faced by men and women in law enforcement.
"The doctors found it to be a complicated case. The delusional disorder that was diagnosed was rare."
Follow @BillGraveland on Twitter
Also on HuffPost