Massey, 38, pleaded no contest earlier this month to the first-degree murder of 54-year-old Concord resident Donna Gross. The sentence was part of a plea agreement between the prosecution and defense, Deputy District Attorney Allison Haley said.
Massey also agreed not to appeal his conviction and likely will spend his sentence in prison, not a mental health institution, Haley said. He is eligible for parole in 25 years.
Massey had pleaded not guilty and not guilty by reason of insanity before the plea agreement was reached.
Gross, 54, died of asphyxiation after she was attacked in an enclosed courtyard at the Napa hospital.
She took a dinner break around 4:30 p.m., bought gum at a Target store and checked back in at the hospital at 5:15 p.m., Napa County sheriff's Capt. Tracey Stuart said in October.
She was robbed of jewelry, gum and less than $2, Stuart said. Gross's watch, two necklaces and her earrings were found in Massey's room and the gum was found in a trash can on Massey's ward, Stuart said.
The sheriff's office believed Massey used his hands and arms to strangle Gross.
Haley said she believes Massey was sane at the time of the slaying.
"A lot of facts show consciousness of guilt. He dragged her to an isolated area, blamed someone else and hid what he stole," Haley said.
"He knew what he did was morally and legally wrong."
Three members of Gross's family spoke at the sentencing before Napa County Superior Court Judge Rodney Stone.
Gross's daughter Anna Bock told the judge she believes her mother would surely forgive Massey, but she has not, Haley said.
Bock, Gross's brother Dan Kopache and Gross's brother-in-law Gary Farrell are satisfied with the sentence, Haley said.
"Today was very important for them. It's the first time her daughter saw him," she said.
Massey did not make a statement at the sentencing.
Massey was sent to Napa State Hospital after pleading not guilty by reason of insanity to stabbing a woman in a Sacramento parking garage in May 1996.