It took me a while to recognise what I was seeing. It was an ordinary campsite in Pembrokeshire: a square field with tents around the perimeter. But it had a curious effect on the children staying there. Young people who had seldom experienced daylight slowly emerged from their tents and were drawn towards the centre of the field. Bats and balls left on the grass mysteriously appeared in their hands. Children with no prior interest in sport started playing football, cricket and rounders. Little kids ran around with older ones. As children of all classes played together, their parents started talking to each other. It hit me with some force: we had reinvented the village green.

We are, to a surprising extent, what the built environment makes us. Academic papers show that many of the problems we blame on individual behaviour are caused in part by the places in which we live. People are more likely to help their neighbours in quiet areas, for instance, than in noisy ones. A long series of studies across several countries, beginning in San Francisco in 1969, shows unequivocally that communities become weaker as the volume of traffic on their streets increases.

Other papers show that people's use of shared spaces is strongly influenced by trees: the more there are, the more time people spend there and the larger the groups in which they gather. A further study shows that, partly as a result, vegetation in common spaces strengthens social ties. In greener places, people know more of their neighbours, are more likely to help each other and have stronger feelings of belonging. Social isolation is strongly associated with an absence of green spaces.

One fascinating paper shows that crime rates are also strongly affected by vegetation. In housing projects in Chicago with equal levels of poverty, taking account of factors such as size of buildings and vacancy rates, there's a clear association between the absence of greenery and both property crime and violent crime.

Another set of studies demonstrates a relationship between urban planning and body mass index. Where settlements are dense – and therefore able to support public transport – and close to shops, workplaces and recreation places, people are more likely to walk and cycle and less likely to be fat. One paper shows that women living in mixed places, where houses and amenities are close together, have a risk of coronary heart disease 20% lower than women living in areas which contain only houses. Suburban sprawl is partly to blame for obesity. (The references for all these papers are on my website).

Build loose suburbs carved up by busy roads and without green spaces and you help to create a population of fat, lonely people plagued by criminals. Build dense, leafy settlements with mixed uses, protected from traffic, and you help to create safe, fit and friendly communities.

In Sunday's Observer the doctor Steve Field blamed public health problems squarely and solely on sufferers and their parents. It's true that we must take as much responsibility as we can for our health. But Field, like most conservatives, ignores the social and political context, condemning people for problems they cannot tackle alone. He lambasts us for eating junk food while saying nothing about manufacturers who ensure that it's as addictive as the regulations allow. He suggests we should encourage children to get outside and play games. Of course we should, but if there is no safe place nearby in which they can do so we're wasting our breath.

Here's one picture of what a fit, safe and functional community might look like. There's nothing radical or new about it: similar developments have been built for centuries (and most are now monopolised by the rich). Houses or apartment blocks are built densely around a square of shared green space. It is big enough for playing ball games, but without fixed goalposts, allowing children and adults to define the space for themselves. It could contain trees; perhaps rocks or logs to climb on. There might be a corner of uncut meadow, or flowerbeds or fruit bushes. The space will work best when it is designed and managed by the people who live there.

Most important, the houses face inwards, and no cars are allowed inside the square: the roads serve only the backs of the buildings. The square is overlooked by everyone, which means that children can run in and out of their houses unsupervised, create their own tribes and learn their own rules, without fear of traffic accidents or molesters. They have a place in which to run wild without collecting asbos.

There's a council estate a bit like this across the road from my house. Whenever I pass through it on a dry day in the holidays, I see dozens of children playing there. On the other estates here you seldom see children out of doors, for the obvious reason that there is nowhere to play. Proximity is everything: if a park is far away, most families won't go there. Walking across a city with a small child is no one's idea of entertainment.

Those who need such spaces most are the socially excluded. Because of poverty, unemployment and poorer health, they leave their neighbourhoods less often than the affluent. But they tend to have the least access to green spaces. A study of Greater Manchester, for instance, shows that wealthy parts of the city have tree cover of about 10%, the poor neighbourhoods just 2%. Housing built around village greens need be no more expensive and no less dense, just better planned and better regulated.

Instead, whenever I visit a new estate, I see only lost opportunities: houses that turn their backs on each other; spaces that should be dedicated to playing reserved instead for parking; loneliness and exclusion built into the plan. We have allowed property developers and weak planning to define who we are and what we shall become. As the government launches a new scheme for ensuring that more houses are built, we must demand that it recognises a truth all these studies point to: that there is such a thing as society.