I can tell you that I have counseled literally thousands of troops from various (and all) branches of the military. My experience is that there are at least two types of people who often join the military.
The first type are globally competent. They would do well in almost any setting. Not surprisingly, they do well in the military. I think this constitutes the vast majority of soldiers, sailors, Airmen, and Marines.
But there is another type. This type was attracted to the military because of its structure. They were only marginally functioning before they enlisted. They needed the structure and sense of belonging of the military to “save” them. They desperately hope that some organization will give their lives meaning. Hence, we have the Bradley Manning phenomenon. Now he is wearing lipstick, eye make-up, and a blonde wig. He has moved on to another object, and desperately hopes that it will give his life meaning. But he will be like a hungry man who goes to sleep and dreams he eats, but wakes up famished or a thirsty man who dreams he drinks but who wakes up still needing water. It is only a dream.
Bowe Bergdahl is in the second group. All he is missing is lipstick, eyeliner, and a blonde wig and then his journey to the dark side will be complete. But trust me, that will come, in one form or the other (and it is all fundamentally the same thing), that will come. Mark my words. In many ways it has already come, complete with a body count.
So the military does attract some very competent people. But it also attracts some derelicts, people who are desperately hoping that the military will give some structure and meaning to their lives. People in this second group often wash out in Boot Camp, but not always. They therefore make up a significant minority of the military. They also often try to find identity in unorthodox religions or other strange paths if they do make it through Boot Camp.
But don’t kid yourself, this is an identity issue. These people don’t have a solid sense of self that comes from within (often but not invariably because of poor parenting), and therefore they are desperately looking for an outside source that can give it to them. In other words, this is character pathology.