I recall listening to a podcast about this and the general understanding is that throughout history depressed people weren't cast out. They were supported by the community because even severely depressed were still potentially a valuable asset to the tribe. The potential value of keeping you around outweighed the cost.
You maybe depressed today and incapable of being a productive member of the tribe but you're likely to recover and become a productive member. Then you can help when someone else has become unproductive maybe though injury or some other tribal issue. Even depressed you're too valuable to the tribe to just discard.
I don't know how accurate the podcast was about it but it makes sense in my mind. Its the minority of people that go through crippling totally unproductive level of depression that they never recover from so it makes sense that the tribe assume you will recover one day than to cast out everyone that goes through a depression.
The tribe gained more by keeping you around than it did by discarding everyone that became unproductive.