There is a somewhat sinister implication here: if group cohesion is best ensured by the establishment of a hierarchical social/power structure, then such power structures themselves (of which religion is one) become effective tools in ensuring group cohesion. Thus we encounter a worrying form of Error Management Theory at a higher social level –
even though ceding power to a ruling elite (political, religious, social, etc.) may be detrimental to the wellbeing of an individual (perhaps acutely so), it is nevertheless felt to be advantageous to the survival of a society (or humanity more generally).
The last distinction might itself be taken further, as such imperatives often lead to political or religious conflict (most obviously exemplified by wars between 'rival' societies and oppressive regimes enforcing social unity) which, although they cost the lives of many people, apply the ‘survival of the fittest’ dictum to groups rather than individuals, the most ‘forcefully resilient’ group having the best chance of survival, again favouring a high degree of social cohesion.
One could thus argue that evolution/natural selection is at the root of much that makes us 'messed up' as individuals and as societies, and that the sheer force of 'evolutionary instincts' makes it extremely difficult to work towards a more open-minded, aware and understanding state of affairs. As a final point, this raises the issue of a potential conflict between 'survival' and 'social progress' imperatives, the latter also being advantageous from an evolutionary point of view (although less immediately than the former). This would suggest a somewhat sinister dialectical exchange between two evolutionary processes.