Why do some people think that just because we know we are going to die someday, that means we have nothing to live for?
Think about all the technology stuff that we use every day; just because we know someday it won’t work anymore doesn’t mean we shouldn’t use it anymore.
People don't really think that, it's just fear of death. If they REALLY believed that there was no afterlife, they'd find something to live for, the vast majority of them. Sure, some people suffer from depression, but very rarely is it nihilistic/philosophically driven, but rather chemically driven to actual mental illness.