Murphy's lawyer Dan Gardiner argued his client did not deliberately target old people, despite four of the victims being elderly women, and said the offending had a "strong opportunistic element".
But Justice Mark Woolford disagreed.
"Your actions were calculated and planned, albeit not hugely sophisticated," he said.
The judge also said there was a worrying escalation in Murphy's behaviour over the course of the spree.
The slew of offending began with the defendant stealing a handbag from an Auckland Hospital visitor, but weeks later he was forcing his way into a unit at a Pakuranga retirement village.
When the elderly woman living there resisted, he punched her in the face several times and forced her to take off her trousers and underwear.
After rifling through her belongings, he found credit cards and demanded she told him her pin numbers, holding a knife to her throat.
The victim, who was in court this morning, described the ordeal as "indescribably frightening" and questioned what Murphy might do next if he was released.
Another victim said the incident had traumatised her to such an extent she lay on the ground vomiting at times through fear the defendant may return.
The court heard how Murphy - a father of three - suffered an unstable upbringing peppered with violent abuse, which saw him leave home at an early age.
He came to the attention of police as a 14-year-old after a burglary which featured an attempted sexual violation.
Since then he had racked up a lengthy criminal history including several sexual convictions - a rape in a retirement home among them - and more than two dozen for thefts and burglaries.
After another burglary and indecent assault in 2007 the High Court considered him for preventive detention but opted to impose a prison term of seven years instead, along with a final warning.
"Extensive counselling during the last period of imprisonment has not worked," Crown prosecutor Claire Paterson said.
"The time has come. It's clear now such a sentence [of preventive detention] is required to protect the community from the defendant."
Justice Woolford agreed and imposed a minimum non-parole period of six years.
Murphy's latest crimes came while he was supposed to be undertaking counselling for his wide-ranging issues and the judge said he hoped the defendant would continue to make efforts at rehabilitation while behind bars.
Outside court, the Pakuranga victim said she was relieved at the outcome but the pain she had lived with since the incident meant she was looking to move away from Auckland.