“Geography is destiny.”

Economists once used this theory to try to explain the difference between rich and poor countries. But in the last few years, something like it has become a grand theory for rich and poor within the United States. Researchers have shown that where a family lives dramatically shapes children’s education, income, and their potential to earn more than their parents.

Geography’s most consequential legacy might be life itself. In a new study released Monday morning and reported in The New York Times, the life expectancy of the poorest Americans can differ by many years in neighborhoods that are fewer than 100 miles apart. In the belt running from Texas through Michigan, the typical lifespan has fallen behind the national average. Meanwhile, Americans living in cities, particularly on the coasts, are not only living longer but also have lower incidences of diabetes, stroke, heart attacks, and high blood pressure. Where one lives shapes when one dies.

Why are America’s poor dying young? According to the paper, the causes are internal. Most of the variation in life expectancy doesn’t come from “external factors,” like murder, but rather from medical causes, like heart disease and diabetes. The poor die early because they get sicker faster.

And why do the poor get sick? Several variables could not explain it, like access to medical care, their environment, income inequality, or labor-market conditions. Instead, the most important correlations were with behaviors, especially smoking and obesity (both highly negative) and exercise (positive, but the relationship was slightly little weaker).

It sounds like the most predictable finding in the world. If somebody eats healthy food, exercises regularly, and doesn’t smoke, on average she’ll outlive someone who eats junk food and smokes on the couch in a dangerous part of town.

But it poses a question whose answer is anything but obvious: Why do the poor in some cities have such unhealthy lifestyles? Researchers know the places where the poor live the longest. They are: New York, San Jose, Santa Barbara, Santa Rosa, Los Angeles, San Francisco, San Diego, Miami, Newark, and Boston. Several of these cities—particularly San Jose and San Francisco—are also among the most expensive places to live. Is it possible that building more housing for poorer Americans to live in these areas might introduce them to environments where healthy behaviors are already the norm, improving not only their economic fortunes but also their health?

* * *

People act like the people around them. It’s well observed in sociology that behaviors ranging from an innocuous interest in fashion to a propensity for smoking can spread through local networks, like a virus. There is extremely strong evidence that every behavior identified in the health-inequality paper—smoking, obesity, and exercise—can spread infectiously through social groups.

“If your friends are obese, your risk of obesity is 45 percent higher,” says Nicholas Christakis, a Yale University professor who is one of the country’s leading researchers on socially contagious behaviors. “If your friend’s friends are obese, your risk of obesity is 25 percent higher. If your friend’s friend’s friend, someone you probably don’t even know, is obese, your risk of obesity is 10 percent higher.” Christakis has even found that the mere onset of obesity can be infectious. If somebody becomes obese, it increases his friend’s risk of obesity by about 57 percent.

Smoking habits are contagious, too. The U.S. smoking rate has fallen by about 50 percent in the last half-century, but the vast majority of that decline happened among the rich. Families in the top 10 percent of earners decreased their smoking 62 percent between 1965 and 1999, while the poorest families only reduced their smoking by 9 percent. Americans with a GED certificate are eight times more likely to smoke than Americans with a graduate degree.

Awareness alone cannot explain a gap that large, but peer pressure might. Almost all smokers know smoking is bad for them; they can read the warnings on the packs. But it’s much easier for people to quit smoking when they’re around other people who don’t smoke—and lately, those people tend to be wealthier. According to Christakis’s research, a smoker is about 35 percent more likely to quit if a coworker or friend quits at the same time. “Smoking behavior spreads through close and distant social ties,” he wrote in The New England Journal of Medicine. “Groups of interconnected people stop smoking in concert.”

Finally, exercise habits benefit from social influence. A person is more likely to prioritize exercise when her family, friends, and coworkers value working out as well. “Lack of social support for exercise” is one of the most important barriers to physical activity, according to Active Living By Design, a health advocacy group. Having support from a friend makes exercise habits significantly more likely to stick.

* * *

The contagiousness of healthy behavior is important, because the United States is heavily sorted by income. The rich cluster in high-income suburbs and metros. But not all sorting is by choice. Housing and transit policies force poor and even middle-class Americans away from the country’s richest, densest, and most productive places to live.

If health were contagious, one would see it in the data. Rich cities would become collectively obsessed with diet and exercise, while poor areas missed out on cultural waves of healthy behavior. As a result, the health gap between the rich and poor would grow.

This is exactly what’s happening. The richest 1 percent of men now live about 15 years longer than the poorest 1 percent, like the difference between being born in Germany and being born in Rwanda. The gap has grown significantly since the turn of the century. Geographical sorting is concentrating poverty, but it might also be creating neighborhoods that entrench bad health behaviors. There is already evidence that among poor and unhealthy neighborhoods, parents pass down bad habits to their children. By the time they are 5 or 6, children in less healthy areas drink more sweetened beverages, eat more fatty foods, watch more TV, and get less exercise.

The fact that some health behaviors might spread through networks is not an excuse to overlook the many structural barriers that prevent healthy eating and exercising. Junk food is cheap, and the density of convenience stores in poor neighborhoods makes it readily available. Long commutes, dangerous neighborhoods, and a lack of recreational facilities in poor areas make it difficult for poor parents to make time for exercise.

But the contagiousness of bad health behaviors could make these problems worse. By concentrating poverty in the U.S., policymakers have also concentrated deadly habits and raised the likelihood that young people in poor families will grow up in neighborhoods where bad health behaviors are the norm.

* * *

What’s the fix?

When the government wants to change public habits, it tends to focus on supply: Ban the bad stuff, promote the good stuff. Local governments tax cigarettes. They ban trans-fats. They build grocery stores near low-income areas.

These are often good ideas. But what if governments thought about promoting healthy behaviors in a complementary way—by raising the demand for healthy habits by building more housing in or near the healthiest neighborhoods? When people join a group that exercises, they become more likely to exercise. When they join a group that doesn’t smoke, they have more social support for quitting. The same might happen at a city-wide level. When a city builds a park, it doesn’t just give families a place to exercise; it also creates a norm of public physical activity, which the neighborhood’s newest entrants might see and mimic. A city that bans smoking in restaurants not only makes it harder for smokers to find places to light up; but also, it creates a culture where quitters can give up cigarettes together.

Policymakers understand the economic benefits to dense housing in rich and productive cities, like San Francisco, New York, and San Jose. But there might there also be health benefits, too. Rich cities are America’s capitals of healthy lifestyles. If healthy behaviors are both local and contagious, there is a powerful moral case for building more housing in these healthy cities. It might be, literally, a life-saving policy.