Prosecutor Jennifer Bain made the claim as she gave her closing speech at the trial of Garry Kane at the High Court in Dumbarton.
Kane, 41, is charged with the murder of Kathleen Milward at her home in Stonehouse, Lanarkshire, on January 3.
Ms Bain yesterday urged jurors to convict the ex-paratrooper of the 87-year-old's "senseless" murder.
They previously heard how Kane had been staying with his gran at the time of her death.
The advocate depute said: "Kathleen Milward made the mistake of putting a roof over her grandson's head when he had nowhere else to go, and for this she was brutally murdered."
Kane denies murder. The trial, before Judge Lord Matthews, continues.