I think even the idea of having a tombstone is a sort of legacy. People made cave-paintings to leave something behind. We all want to cling to existence somehow and want to leave a mark on world when we leave. The simplest way maybe is to have children, so your gene would live on after you.