The purpose of depression isn’t to drive people to suicide (I also disagree with the idea that becoming an atheist is giving up hope but I think that’s another node . .). The purpose of depression is to drive us to be social. Being social leads to happiness, sex and children, so the depressive tendency (when left alone) is selected for. Sometimes people self-isolate or become unable to connect emotionally with others and they get trapped in depression, but I believe that even for these sad people there is a way out.