No one that close has died, luckily, in my case. But I can get quite emotional if people I knew pretty well (luckily no close friends even) die, some relatively young. No one is supposed to die young. There is a life that is supposed to continue with them in it. How can life be such that people that have so much they still could add to this world, to enrich it, can't do that just because of something as mundane as death.
But it just happens. No complex, redeeming reason. It just is.
Maybe those who are left behind are supposed to keep the person alive, by remembering and continuing to appreciate all aspects of the life left behind. To be a better person thanks to that, despite all.
I hope that makes sense.
Edit:
Also because I'm always wary and unsure I might say the wrong thing, at funerals and in similar situations. Just because I can't imagine how it feels if someone really close to you dies. Might be very different from what I described.