You should do it for yourself, out of respect for the person who died and respect for the loved ones remaining. Not out of societal obligation
The corollary to that is there are plenty of times where the right thing is to not go to the funeral. If you lack those things.
There have been times I don’t go the funeral. Because the dead person was a horrible person. When people asked, I said exactly that and many times the response I got was “man I wish I had not gone”