Stupidity can be adaptive, and not just by encouraging overpopulation. According to James F. Welles, in Understanding Stupidity,
In terms of intellectual development, stupidity may justly be viewed as both adaptive and maladaptive. In the short run, it is adaptive in that it helps an individual adjust to his cultural group’s values by permitting him to accept any obvious contradictions between the real and ideal. As a means to short-term adaptation, stupidity is a classic example of the “Neurotic Paradox” in action. The neurotic paradox promotes behavioral patterns which are subject to immediate short-term reinforcement although the long-term results will be clearly negative. (A drug addiction would be a commonplace example of this basic psycho/physiological principle of learning and life.)
If stupidity is adaptive, in that it helps one fit into his immediate surroundings, it is maladaptive over the long run, as it inhibits innovations and constructive criticism of the social environment. Individuals adjust to the group, but the group loses its capacity to adjust to its surroundings as members sacrifice their individual integrity, insight and ideas and conform for the reward of social acceptance.
Of course, the bottom line, net effect of stupidity is negative, but its universal presence cannot be understood without recognition of its role in helping people adapt to their immediate situation. Thus, it becomes clear how there can be so much stupidity around although it is, in the long run, maladaptive. Survival within the system is promoted if one is so stupid as to accept the system’s stupidities. Also, short-term survival of the system (institution, group, whatever) is promoted through enhanced social cohesion and cooperation. However, these immediate gains are countered by the long-term loss of induced inefficiency of information processing. Our cultural life is really a very human trade-off between these two dependent features: 1.) objective, rational, logical processing of information, and 2.) group cooperation and cohesion.
Accordingly, what might be regarded as stupidity may in fact be a healthy, short-term compromise with group cohesion. Real stupidity comes when either factor (logical information processing or social cohesion) predominates to the disruption of the other.
See also “Survival of the stupidest“.