People laugh at funerals because it helps to relieve the stress and grief they're feeling during the funeral.
It's a way to make the person feel better and it's totally okay to laugh at a funeral even though it seems wrong.
They're not laughing that the person died but they're just trying to get relief from the stress.