lack of something better to say. They are truly at a loss for words.
They want to say something so that those suffering will know that they care. So they say something like "he's in a better place now" -- trying to offer comfort, but as you say, it doesn't always make those who are left behind feel better.
The spirit of what they are saying is to offer comfort, but unfortunately, such statements aren't always comforting. I would credit them for trying to say a kind word.