Nine years ago, Mayor Michael Bloomberg launched an ambitious effort to reduce homelessness in New York by two-thirds over five years. His blueprint included more than 60 goals with timelines aimed at getting thousands of people off the streets and into permanent housing.

"We will continue our work until all New Yorkers have a place to call home," he promised at the time.

Unfortunately, it hasn't turned out that way.

A recent ruling by the state's top court offered a glimpse into how much ground the city has lost in its push to house the homeless. The court told the administration that it couldn't turn away single adults from shelters when they fail to prove they have nowhere to go. While the decision was made on procedural grounds, it also made good sense in pragmatic and humanitarian terms.

The city argues that many seeking shelter have friends or relatives who might take them in, and it's not fair for them to take up space in an overburdened system. It also points out that a similar requirement has been in place for 16 years for families seeking shelter.

Advocates for the homeless answer -- reasonably -- that unlike families seeking shelter, a greater proportion of homeless adults have problems with substance abuse or mental illness. They often lack the paperwork they need to satisfy Department of Homeless Services workers.

Turned away from shelters, many would sleep in parks, on sidewalks and in other public spaces -- an option that's bad for them and bad for city neighborhoods.

And Bloomberg's reforms? Let's just say they ultimately were defeated by shrinking federal and state housing supports and the Great Recession.

The city's homeless census was 38,000 in 2004, when Bloomberg made his promises. The shelter census taken on Friday was 51,000 -- including nearly 11,000 families with children and almost 10,000 single adults.

Bloomberg tried to make the system better than he found it. But in the end his program fell short. Now Mayor-elect Bill de Blasio faces the herculean task.