Actually, in many cultures throughout time, many people have pushed the limits of existence in order to find is what is at their core.
In times not that long ago in Japan, for example, adherents of Shugendo, Esoteric Buddhism (Shingon & Tendai sects), and Koya Hijiri all practiced forms of what we would call extreme deprivation in order to achieve higher levels of self realization / enlightenment. These exercises included fasting, sleep deprivation, exposure to the elements, etc.. .
It was thought that if one pushes themselves to the point of death (the last, greatest fear), then the individual would be imparted with an experience that the average person would not otherwise understand. From this experience, they would have a greater understanding of themselves and their relationship to the world in which they live. Many believe that those who participated would also gain a greater understanding of the world beyond, simply because those who survived had come closer to this realm than the average person would ever dare.
Certain Native Americans often practiced fasting in order to achieve visions. Siddhartha Gautama (Buddha) of India also practiced extreme fasting as part of his ascetic life, often depicted as the emaciated Buddha. Muslim practice fasting during the month of Ramadan.
Many cultures from around the world practice fasting. DM's experience differs in that he comes from a culture that typically does not find it a common practice. It also differs in that most cultures who do practice fasting link it with some form of spiritual / religious rite or passage.
I do not believe DM did it because of depression. He set out to do it, and, had boundaries and goals. He was supervised by his wife who is a nurse. A person not eating because of depression doesnt put all this in place before they begin.
I do not believe DM did it for publicity. Extreme fasting can be dangerous, and, there are much easier ways of gaining notoriety. Part of that is based on intuition, part based on reading his words and listening to his story.
I cannot surmise why DM tested himself in such a way, other than a quest of the individual. I may not understand it, but, it is not mine to understand. With that, I wish him well on his journey.