Think of it this way: suppose you're telling the story of a homeless man.
His wife died in 2004. Before that, when his wife had beenPAST PERFECT alive, he had hadPAST PERFECT someone to live for; but now he gaveSIMPLE PAST up on life. Before that, when he had wantedPAST PERFECT to give her a perfect home, he had hadPAST PERFECT a high-paying job and a fine house; but now he stoppedSIMPLE PAST going to work, he lostSIMPLE PAST his job, he couldSIMPLE PAST no longer make the mortgage payments and the bank foreclosedSIMPLE PAST on his mortgage.
The past perfect occurs only in a past context. Your story starts with her death, and goes on from there; it mentions events before that context, because they in some sense give rise to the situation which obtained at that time, and contrast with your story of what happened afterward.