Friedrich Nietzsche in The Genealogy of Morals (Third Essay) argues that in response to a lack of ability to answer questions related to the purpose of life, people will rather choose to commit suicide than to choose nothing at all.
If you except the ascetic ideal, man, the animal man had no meaning. His existence on earth contained no end; "What is the purpose of man at all?" was a question without an answer; the will for man and the world was lacking; behind every great human destiny rang as a refrain a still greater "Vanity!" The ascetic ideal simply means this: that something was lacking, that a tremendous void encircled man—he did not know how to justify himself, to explain himself, to affirm himself, he suffered from the problem of his own meaning. He suffered also in other ways, he was in the main a diseased animal; but his problem was not suffering itself, but the lack of an answer to that crying question, "To what purpose do we suffer?" Man, the bravest animal and the one most inured to suffering, does not repudiate suffering in itself: he wills it, he even seeks it out, provided that he is shown a meaning for it, a purpose of suffering. Not suffering, but the senselessness of suffering was the curse which till then lay spread over humanity—and the ascetic ideal gave it a meaning! It was up till then the only meaning; but any meaning is better than no meaning; the ascetic ideal was in that connection the "faute de mieux" par excellence that existed at that time. In that ideal suffering found an explanation; the tremendous gap seemed filled; the door to all suicidal Nihilism was closed. The explanation—there is no doubt about it—brought in its train new suffering, deeper, more penetrating, more venomous, gnawing more brutally into life: it brought all suffering under the perspective of guilt; but in spite of all that—man was saved thereby, he had a meaning, and from henceforth was no more like a leaf in the wind, a shuttle-cock of chance, of nonsense, he could now "will" something—absolutely immaterial to what end, to what purpose, with what means he wished: the will itself was saved. It is absolutely impossible to disguise what in point of fact is made clear by complete will that has taken its direction from the ascetic ideal: this hate of the human, and even more of the animal, and more still of the material, this horror of the senses, of reason itself, this fear of happiness and beauty, this desire to get right away from all illusion, change, growth, death, wishing and even desiring—all this means—let us have the courage to grasp it—a will for Nothingness, a will opposed to life, a repudiation of the most fundamental conditions of life, but it is and remains a will!—and to say at the end that which I said at the beginning—man will wish Nothingness rather than not wish at all.
Philosophy could be of crucial importance to decide whether it is possible for mental problems to be hopeless in nature. Social evolutionary factors such as the fall of religions should be considered. Without religions, where will insecure people go for guidance? And is it ethical that a doctor presents them with an option to end life?