You can have it in your will to be passed onto family members, different organizations, etc if you like
Plus, before you die you will need the money so even if it might not matter to you after you have passed, you will still need money to live while you are alive. For example, shelter (housing), food, etc :)