Doesn't surprise me at all. Depression evolved as a means of keeping us alive when external circumstances become unfavorable and are beyond our control. Expending effort trying to change those circumstances is counter-productive, as it will deplete your stocks of energy and make you die sooner. Depression makes you feel miserable and, basically, it forces you to curl up and do nothing. Doing nothing is the right strategy in such situations, as it minimises your use of energy, and thus increases your chance of surviving until better times arrive.
There must be some DNA influence in all that. Many people who suffer from lifelong depression are the victims of genes that are too enthusiastic in producing depression i.e. they make you depressed even in the absence of unfavorable external circumstances.
I can think of several other situations in which a "good" response gets switched on in inappropriate circumstances, making it a "bad" response. Hayfever sufferers (of which I am one) are victims of the part of your immune system that protects you from macro-parasites. In hayfever, or other allergies, it gets switched on too easily, even when there is no real threat. .Another common malfunction comes from the system that protects you when you are seriously injured; it makes your blood pressure drop a lot so you don't bleed to death. In me that system is triggered far too easily, and gets turned on if someone sticks a needle in me, for any medical procedure. When that happens, my blood pressure plummets and I faint. My father had the same problem.