Good question! I've never really understood it myself, especially because I have a hunch that a lot of people just do it to stay relevant and build their "social media clout" (i.e. narcissist \_()_/ ).
Here's my two cents though: personally, I don't bother with the hype and public declarations and shit, but I do spend some time listening to their music. A lot of the time, if I've been a fan for a while or really enjoy their music, it's a weird form of paying respect to them and their craft. Basically acknowledging their impact on the industry and listening to their highlights of the career. It's not that I treat or think of them them any differently than I did when they were alive, I just stack my playlists with their songs for a good while to say goodbye. Paul Gray, Chester Bennington, Lemmy, Jeff Hanneman, and Neil Peart come to mind.