While I'm not exactly an atheist, I'm probably close enough to answer your question. As a deist, I don't believe in any sort of metaphysical afterlife, any sort of divine judgment, any sort of purpose to life beyond what we give it.
And yet, I'm the happiest person I know.
It's no more difficult than this: I care about the things I value. I love my country. I love my family. I love my culture: science, literature, art, etc. When I die, I want to see these things in good condition, so that they will be as healthy and prosperous as possible for as long as possible after I'm gone. Because I love them, I work hard on their behalf. What has that to do with God or an afterlife? They matter to me, and that's enough.
Furthermore, it pleases my vanity that I be remembered and held in high regard after my death, and that my works and thoughts continue to exert a positive influence on the things I love and value. That legacy is the only sort of afterlife I have available to me; why wouldn't I seek to maximize it? Why doesn't everyone?
Meanwhile, I'm having a blast. The world is a beautiful place for me. I laugh hard. I live the life of the mind. I enjoy my work. I work very hard and am comfortably well compensated for it. I have a smart and gorgeous wife, and I love to take her out dancing. We have four wonderful kids. I'm healthy and reasonably fit (for my age). I have a splendid book collection and a big house to hold it. I look out my window to a lovely vista in Pennsylvania Dutch country, which I adore. I enjoy fine Scotch whisky, delicious food, great literature, and good music. How dare I not be happy?
"Life is like a sewer, what you get out of it depends entirely on what you put into it" - Hen3ry, as related by Tom Leher...