Deaths of famous people sadden me, especially if they or their work had a big impact on my life. I'm thinking especially of George Michael who I adored as a teen.
Their death marks the end of their creativity and talent. We can still enjoy George Michael's music but there will be no new singles or albums or concerts.
As @MeinKraft wrote, often it's more about ourselves than about the person who died. Their death is a reminder that time is passing and we can't turn back the clock. I'll never again be that 12/13 year old bopping away to 'Wake Me Up Before You Go Go' and 'Freedom' at the school disco. Or dreamily writing Tayto Michael on the back of my school copies. His death made me sad for the loss of that teenager (me).
Where the person died before their time (applies to both George Michael and Matthew Perry), there will be regret that they were taken so early. Fame seems to have been a double edged sword in both cases and they both battled their own demons. So there's a sadness that their fame, success and wealth didn't bring them happiness. Or came at a huge cost. And perhaps a tiny bit of guilt - did I (inadvertently) contribute to that unhappiness simply by being a fan?
Finally, it's a reminder of our own mortality. At the risk of sounding morbid, if death can come for these legends of entertainment, then it will surely come for us.
It's a very different sadness to the grief that their families and friends will feel because they knew them as a person and they will miss that person. I never married spoke to George Michael, never shared a joke with him, never went for coffee or lunch or a drink with him, never hugged him, never went on holiday with him. He didn't even know that I existed. A celebrity's friends and family will know them in a way that their fans never could and their grief will be immense.