Another syndrome so common that it must have served some evolutionary purpose is depression.
If you were immune from even situational depression back in the caveman days, you could have had barely enough food to eat, no decent shelter, and no mate -- and be fine with that. (In today's terms, you would be homeless.) This was obviously not a prescription for passing your genes along to the next generation. The lack of each of these things should be a downer, so that you will be more inclined to acquire them -- to avoid feeling depressed.
If everything is going well for you -- if you've hunted successfully, if your belly is full, if you have enough meat left over to share with others, and if you've devised a shelter which keeps you safe from predators, you're much more likely to find a mate -- and have offspring. On the other hand, if you're happy not to have those prerequisites for sex, or even sex itself, you will not pass along your genes. This is why the lack of a mate -- or, to put it in more romantic terms, unrequited love -- can be depressing. (It may also be why it's hard to be depressed right after getting laid -- at least if you're a guy.)
Another thing people tend to get depressed about is others not liking them: this is why we try so hard to fit in. This sounds like a character flaw, but in fact there is a good evolutionary reason for this. In the hunting and gathering era, popularity was a matter of life and death: if other people wouldn't help you hunt, or give you food, or share their shelter, you would die. And if they really disliked you, they might even try to kill you. (These are good reasons to be depressed.)
So the genes for depression are in fact adaptive; this is why we all have the capacity to be sad. People who suffer from chronic depression -- as opposed to situational depression -- are those who simply get too many of the genes which facilitate the capacity for sadness. Such chronic depression is, of course, not adaptive. (If you're depressed enough for no reason, the depression can prevent you from accomplishing anything, and eventually you'll have good reason to be depressed.)
There is a saying which may hold the key to another reason depression is adaptive: "Depressives are just those who see the world most clearly." (A saying which sounds as if it were coined by a depressive.) Taking realistic stock of a bleak situation is almost always the wise policy. Narcissists with their heads in the clouds are simply not going to survive as well. ("I can outrun that lion if I need to"/ "They admire me, they'll forgive me if I steal a little of their meat.")
Avoiding depression is a strong motivator: nature has programmed us to change, or at least avoid, whatever depresses us. We are all, more than we like to think, like B.F. Skinner's rats, mindlessly rushing around doing whatever it is that makes us feel good -- or at least prevents us from feeling bad.
Which isn't such a bad thing, evolutionarily speaking.
Manic depression, now referred to as bipolar disorder, may also have its benefits. In a manic phase, you feel as if you can do anything. In that mood, you are more likely to take on a large project such as building a sturdy shelter, or a fancy trap. In a depressive phase you would be more likely to regard these tasks as impossible. So mood swings allow you to simultaneously -- or almost simultaneously -- be ambitious and hard-working, intermixed with frequent doses of cold, brutal reality. In a way it's ideal.
Manic depression is also reportedly linked to creativity. Devising a more effective weapon would have obvious evolutionary benefits. (Again, of course, extreme manic depression is debilitating.)
So the next time you get depressed, remember, that is just your ancestors telling you to change your situation so that they will have more descendants. And the next time you're feeling manic, put that energy to constructive use.
The only problem with that advice is, the nature of depression is such that when you're down, you won't be able to put a positive spin on your depression. And when you're up, you're either going to be working hard or partying hard anyway, and not in the mood to take such a suggestion.
So let me instead offer some advice which I feel quite certain you will take: live your life the way you do already, and forget about this post.