New York’s state capitol in Albany is not known for producing a lot of good ideas. As the Brennan Center for Justice at New York University puts it, “The New York State legislature is nationally notorious for its dysfunction and subservience to special interests.” And yet a creative response to New York City’s astronomical cost of living has just emerged from the cesspool.

State Sen. Brad Hoylman (D), who represents part of Manhattan, has announced his intention to introduce a bill that would place a property tax surcharge on the most luxurious homes in New York City owned by nonresidents. (New York City requires the state’s approval to raise taxes.) Modeled on a proposal issued last week by the left-leaning Fiscal Policy Institute, it would apply to properties valued at $5 million or more, adding a tax of 0.5 percent for the first $1 million in value over $5 million, and gradually rising until the rate tops out at 4 percent for the value over $25 million. FPI estimates $665 million could be generated from 1,556 such coops and condos owned by nonresidents. (People’s primary residences would not be affected. Primary residence is presumably determined by where you file and pay your income taxes.) New York City Councilmember Corey Johnson (D) will introduce a companion resolution to demonstrate the city’s support, and Mayor Bill de Blasio (D) said he is considering the proposal.

This kind of “pied-à-terre tax” would address a very real problem, and a major flaw in the pro-development arguments of density-celebrating urbanists. When dense cities with surging populations face rising housing prices, environmentalist neoliberal sellouts like me and my friend Matt Yglesias argue that we should let more people squeeze into relatively green, compact neighborhoods — and lower housing prices — by loosening zoning regulations to allow more development. And, in principle, this makes sense. But a problem arises when a significant number of homes are bought by rich out-of-towners looking for a place to stay on occasion, an investment, or a hedge against an unstable currency, economy, or political climate back home. Last year, The Washington Post reports, foreign buyers bought more than $90 billion worth of American homes. Real estate, the Post explained, is “an asset class denominated in U.S. dollars, safe from confiscation and, when necessary, bought anonymously to hide wealth from governments or creditors or ex-partners.”

A message from The Wilderness Society:

Senate is voting on a bill this week that would allow drilling in the Arctic Refuge. Help stop it!

The problem is especially acute in Manhattan. The median apartment in Manhattan currently goes for almost a million dollars, and the average apartment fetches over $1.7 million. It is now spreading beyond Manhattan to the outer boroughs. In May, the largely working-class borough of Queens saw a record-setting $3.35 million apartment sale to a Colombian buyer.

This phenomenon goes far beyond New York to cities in the other corners of the country, from Miami to L.A. and San Francisco. As The New York Times recently reported, “Brokers and analysts say 20 to 40 percent of $1 million-plus homes sold on the Eastside — a collective term for eastern suburbs of Seattle — were purchased by Chinese buyers.” Nationally, the Times noted, the median purchase price for Chinese buyers is $523,148, almost twice the U.S. average, and three-quarters of their purchases are in cash.

Nor is it unique to the U.S. “Foreign buyers dominate London’s luxury housing market,” the BBC reports. Housing prices in London are up 20 percent just this year, with the average one-bedroom apartment renting for about $2,000 per month. The result: Growing numbers of Londoners are resorting to living in houseboats, causing congestion on the city’s canals. In Sydney and Melbourne, Australia, foreign buyers accounted for 39 percent of new home purchases in 2012-2013. From mid-2013 to 2014, house prices have risen 15.4 percent in Sydney and 9.2 percent in Melbourne. UBS, a global financial services firm, says the “sharp” increase in foreign buyers is “quite material” to the rising prices.

The logic of letting the free market balance supply and demand to fix housing prices depends on the demand side being composed of people who actually live in the city. When it is, prices are limited in part by how much money people there make. But when rich people who don’t live there buy up properties, prices can be totally out of sync with the wages of residents, making the cost of living unaffordable. As the San Francisco Business Times reported last year, “With a median home price of $706,300 in San Francisco, someone earning the median income of $74,922 makes 48 percent less money than they need to afford a median-priced home. For the median home price to match the median income, workers would have to bring in a median of about $111,000.” There are other reasons for housing unaffordability in San Francisco, like enormous income inequality, the influx of highly paid tech company workers in Silicon Valley who live in San Francisco and reverse-commute to suburbia, and the large number of homes being rented nightly to tourists instead of monthly for housing. But the skyrocketing interest from foreign investors is one factor.

This can drive the prices for homes far beyond the reach of middle-class families. Thanks to an influx of wealthy foreign investors, Vancouver has the highest housing prices in all of North America. As James Surowiecki of The New Yorker recently observed, “Nothing about its economy explains why — in a city where the median income is only around seventy grand — single-family houses now sell for close to a million dollars apiece and ordinary condos go for five or six hundred thousand dollars.” The explanation is that nearly half of all luxury home sales last year were to foreign buyers, particularly from China. Among the reasons: Vancouver’s mild weather is a hedge against climate change, and Chinese cities’ air quality is atrocious. It’s one way the global elite are insulating themselves from the problems of their own creation.

Since Russian oligarchs and foreign investment funds can pay in cash, it not only drives up the price but makes it impossible for anyone without millions of dollars in the bank to compete. As New York magazine writes, “New Yorkers with garden-variety affluence — the kind of buyers who require mortgages — are facing disheartening price wars as they compete for scarce inventory with investors who may seldom even turn on a light switch.”

Out-of-town owners don’t just drive up real estate prices. Absenteeism is also bad for neighborhoods and their sense of vitality. In Vancouver’s Coal Harbour, one-quarter of homes were unoccupied on Census Day. In Manhattan, according to New York, “the Census Bureau estimates that 30 percent of all apartments in the quadrant from 49th to 70th Streets between Fifth and Park are vacant at least ten months a year.” (This covers a prime stretch of Midtown and the Upper East Side, where many rich out-of-towners buy.) Area residents complain of the creepy feeling of living in a zombie neighborhood where no one is ever at home. This isn’t good for New York, or any city.

When you want less of something, just like carbon, you tax it. The revenue from a property tax surcharge could be used to build and maintain affordable housing, distributed to low-income New Yorkers in housing vouchers, or put to another purpose that benefits city residents. The only problem with the proposal is that it is applied too narrowly. Why only apartments worth more than $5 million? Lowering the threshold to $2 million would rope in way more apartments, thus bringing in more revenue or scaring off more rich people who don’t even want to actually live in the city anyway. (The bill could, and should, be crafted to exempt properties that are rented out for most of the year, because they aren’t taking an apartment off the housing market.)

To state what should be obvious, this is not a matter of xenophobia. Many of the owners of luxury pieds-à-terre in New York or San Francisco are wealthy Americans who live in the suburbs or other regions. The tax would fall on them just the same as foreign buyers. And foreigners who are actually immigrating and buying a new home to live in, no matter how rich, would not be taxed any more than their neighbors.

But would the tax turn away potential buyers? New York’s real estate developers, a bunch of selfish crybabies to rival Wall Street, say it would not only do that, but bring mayhem, destruction, and death to our fair city. With the trademark hysteria of any coddled industry facing the prospect of minor regulation, Steven Spinola, president of the Real Estate Board of New York, told The Wall Street Journal: “It’s probably a good way to start the collapse of the residential market.” As if there were a shortage of upper-middle-class New Yorkers ready to buy new apartments in prime locations for slightly less outrageous prices! In Crain’s New York Business’s industry-friendly phrasing, real estate developers are “arguing it would idle the construction of luxury towers — and the union jobs that go with them — as well as hurt property values.” The real estate industry cannot fathom that hurting property values is exactly the point. Property values are too high, and New Yorkers cannot afford them.

The idea that attracting rich people is always in a city’s best interest is overly simplistic. So is the belief that the free market solves all ills. Rich people only bring economic activity if they actually bring themselves. Cities need jobs, but they also need affordable housing for the teachers, firefighters, garbage collectors, janitors, store clerks, nurses, bus drivers, and environmental journalists who make the city run. So cities need to use regulation and taxation to help bring housing supply and demand back into balance. Construction jobs are used as the justification for all sorts of real estate development boondoggles like sports stadiums. But a healthy long-term economy cannot be built on short-term construction jobs. Just ask Las Vegas, Phoenix, or South Florida how they fared after the last boom-and-bust cycle.

It will be interesting to see how de Blasio, who ran on an economically populist platform but is friendly with the real estate industry, will come down on this. More interesting, and important, will be how it plays up in Albany. Thanks to gerrymandering and a few soulless, self-aggrandizing Democrats who deserted their party to form a coalition with Republicans, the GOP shares in control of the Senate, despite New York state’s overwhelmingly Democratic electorate. It’s hard to imagine any Republican-led chamber allowing such a progressive measure to pass. But New York state senators only make $79,500. If any of those suburban Republicans want to retire to Manhattan, they should think about voting for Hoylman’s bill.