Richard Dawkins's theory of altruism in The Selfish Gene 'is not enough to explain all of the co-operation and friendliness that we see in humans.' Photograph: Murdo Macleod

This week's Nature has a report on how hunter-gatherers co-operate, which shows the way in which the scientific study of altruism has moved on since The Selfish Gene. That book popularised two explanations for our unselfish instincts and behaviour. The first, and nowadays obvious, reason is that it causes genes associated with it to spread: if I am helpful to my relatives, my descendants will have more relatives. The second is Robert Trivers's model of "reciprocal altruism": over time, co-operation pays, and nice guys finish first – providing that they are also sufficiently nasty to the nasty guys.

Both these explanations still hold, but they are not enough, by themselves or in combination, to explain all of the co-operation and friendliness that we actually see in humans. To do this, it is necessary to move up from purely individual attributes to consider the ways in which these attributes are shaped by the groups that we form.

Without selection between competing groups, the advantages of co-operation are not great enough to make it spread, or maintain itself within a population. Our benevolent instincts are the products of our social nature, and to analyse human society as essentially an association of individuals is not just morally but scientifically wrong, since that kind of analysis doesn't predict our behaviour accurately.

The researchers for the Nature report studied 205 members of the Hadza, a hunter-gatherer bushman group who "represent possibly one of the most extreme departures from life in industrialised societies, and they remain relatively isolated from modern cultural influences". But the essentials of what they found were also revealed by studies of modernised societies, suggesting that the way we form friendship networks is common across all humanity.

The researchers measured and sampled an enormous amount of data among these subjects: not just age, weight, height, and sex, but hand-grip strength, muscle mass and body fat, as well as genetic relatedness. The most surprising conclusion was that height is a hugely attractive characteristic: tall people have more friends, and far more people who want to be their friends. No other single characteristic showed such a marked effect.

Among the bushmen, though not among all societies, body fat was a predictor of popularity, and hand-grip strength – presumably a proxy for general muscularity – made you more likely to have friends.

By studying not just how people form groups but how they would like to do so if they could choose, the researchers showed very clearly that friendship is a universal human quality.

This is fascinating not just in itself, but also has a certain resonance in the world of religion. This is not because there is anything much in common between the myth systems of hunter-gatherers and those of modern believers. In the modern world it is myth systems rather than shared campfires that mark off different groups. Common stories go together with common interests.

The dominant narrative of modern atheism is a story of liberation. You might argue that this is simply protestantism with a twist: the original protestant narrative was of liberation from the false doctrines of Rome and a return to the primal truths of the unadorned gospels. British and American atheism then turns this into liberation from all false doctrine and from religion itself.

"Organised" religion is the particular villain in these liberation stories, because it can make people pretend to believe things they do not or force them to believe against their natural inclination. But it's difficult to imagine any social network that doesn't function on hypocrisy and that does not maintain itself by social pressure.

And if these kind of accounts of the roots and evolutionary purpose of human friendship are right – which I believe they are – they are also a testimony to the reality of original sin. Friendship flourishes because it is limited, and because the friendless suffer. The great lesson of sociobiological theory is that complete and boundless altruism is impossible in any real world. I had been going to write "in any world that we can imagine" – but the extraordinary thing is that we find it quite easy to imagine such a world and quite hard to abandon the belief that it might exist.