Bill Macumber ABCNews/YouTube Barry Siegel's book "Manifest Injustice" chronicles the saga of Bill Macumber, who was falsely was imprisoned for 37 years for the murder of two people in Scottsdale, Ariz.

What's most galling about this tragedy is that it could have been avoided if not for a legal technicality.

A man named Ernest Valenzuela had confessed the crime to his attorney—before later dying in a prison fight. The attorney's testimony could have vindicated Macumber. Instead, a judge protected the attorney-client privilege of the dead man and let the innocent man go to jail.

When Macumber came to trial in 1975, Valenzuela's former public defender Thomas O'Toole wrote to the trial judge asking to testify about his now-dead client's confession.

However, Judge Charles Hardy wouldn't allow the confession to be heard.

"Let the record show the Court has ruled that the proffered evidence isn't admissible," Hardy said in his ruling, according to the book. "First because the communications to Mr. O'Toole and Mr. Petica [another of Valenzuela's defense attorneys] were privileged because of the attorney-client relationship. There's no waiver of the privilege."

After Macumber was sentenced to life behind bars, his defense team appealed the case all the way to the Arizona Supreme Court.

The state Supreme Court ultimately gave him a retrial because of issues with ballistics evidence.

But in its ruling granting him a retrial, the Arizona Supreme Court ruled the trial court could still "assert" the attorney-client privilege on behalf of the dead man and exclude his testimony if it wanted to.

But yet again, the court ruled against Macumber, with Judge Robert Corcoran saying attorney-client privilege prevented the testimony. Macumber was convicted a second time.

After reading the book, we were shocked that a dead man's rights would supersede those of a living man who was fighting for his life.But according to legal ethics expert Andrew Perlman, who teaches procedure and professional responsibility at Suffolk University Law School, the court made the right decision with respect to the law.

"It is not shocking to me that a court would uphold the privilege here, even though doing so might have produced an unjust outcome in this particular case," Perlman said in an email to Business Insider. "The problem is that if courts reject the privilege any time it might be perceived as necessary to uncover the truth, clients would become quite concerned about sharing any information with their lawyers. Although I believe that there should be an exception to the duty of confidentiality to permit lawyers to disclose information necessary to prevent the wrongful execution or incarceration of an innocent person, I am not convinced that such a disclosure should have the effect of waiving the attorney-client privilege."

Macumber was released from prison in November 2012 after the Arizona Justice Project got involved and filed motions that successfully questioned the judges' decisions to not allow Valenzuela's testimony, The Republic reported at the time.

DON'T MISS: Can James Holmes' Psychiatrist Be Held Responsible For 'The Dark Knight' Massacre? >