The primary purpose of housing subsidies is, well, to house people. But by doing so, they serve another end: They effectively boost the incomes of many poor Americans, narrowing inequality.

A new Urban Institute analysis quantifies exactly how much housing aid affects inequality. Gregory Acs and Paul Johnson looked at the post-tax, post-transfer incomes of American households (adjusted for household size). If you take housing policy out of that picture, households at the 90th percentile have about 9.4 times as much income as those at the 10th percentile. Add in housing subsidies — which cost the government about $36 billion in 2012 — and that ratio falls to 8.6.

But here is the rub: While housing subsidies to the poor help narrow inequality, housing benefits for the rich — the mortgage interest and real estate tax deductions — wipe out some of the effect. Add in those benefits ($70 billion for the mortgage deduction, $28 billion for real estate taxes), and the ratio inches back up to 8.8.

That means our current housing policy still has a net beneficial impact on inequality, and it means that subsidies to the poor do more to narrow inequality than homeowner benefits do to widen it. But this analysis raises anew questions about how we allocate government funds for housing and whether it makes sense to spend so heavily on families at the top (and, yes, the mortgage interest deduction counts here as a tax expenditure, not you keeping more of your own money).

This chart from the Urban Institute analysis illustrates how the greater mortgage and real estate benefits (in blue) mostly go to the wealthiest households, while subsidies (in yellow) go to the poorest ones:

The mortgage interest and real estate deductions boost post-tax annual incomes for families at the 95th percentile by nearly $2,000 (again, these numbers are adjusted for household size). They give families at the 20th percentile on average a lift of about $14.

Housing subsidies, meanwhile, are smaller in scale but effectively target households that need help the most. Most families who receive housing subsidies actually get a lot more than that chart shows, but only one in four poor families who qualify for housing aid ever receives it. So the other 75 percent of poor families drag down those numbers.

To the poor, these more modest benefits have a greater impact on their income, in percentage terms:

Give a family with $100,000 an extra $2,000, and that doesn't change their prospects as much as giving a poor family an extra $800. This is why low-income subsidies do more to narrow inequality than high-income benefits do to widen it — even though we spend a lot more money on the second group.

These two charts suggest that we could narrow inequality even further if we invested more heavily in housing subsidies for families at the bottom, expanding aid to more eligible households. That doesn't mean that reducing inequality should be the primary goal of housing policy. But housing is a place we seldom look to when we're trying to achieve that end.