He found his lead plaintiff at the Holy Name Center for Homeless Men on Bleecker Street. He was a middle-aged former short-order cook named Robert Callahan who drank himself into vagrancy. Though his friends in the Catholic Worker movement thought a lawsuit should focus on Cardinal Terrence Cooke, because so many of the flophouses were run by the Church, Mr. Hayes, more ambitiously, took on the mayor and the governor.

He argued that a clause in the state constitution stipulating that the “aid, care and support of the needy” were public concerns meant that homeless men were legally entitled to shelter. He prevailed, and the consent decree was signed in August of 1981, by which point Robert Callahan had already been found dead on Mott Street. Subsequent litigation established the same right for women and then, eventually for families with children.

The Hayes cause benefited from the narrow understanding of emerging social realities held by the city’s legal team and its advisers. As the case moved along, advocates argued for 750 beds to be set aside. Assuming that this was a brash overestimate, the city answered that shelter space should be allocated on an as-needed basis. Almost immediately after the decree was signed, it was clear that the need ran much higher. Advocates were back in court by the fall fighting for more beds.

“I don’t think they understood their own system,” Kim Hopper, a medical anthropologist at Columbia University, told me. The lowest-rung civil servants, he pointed out, were shunted to shelter services. His work on homelessness and testimony in the Callahan case proved crucial. When lawyers for the city recognized that they were likely to lose, they decided to settle. What the city gained was a greater control over shelter placement and the ability to keep shelters out of neighborhoods where they might produce the most backlash.

Even now, though, an understanding of homelessness among seasoned Democratic politicians is often deficient. Echoing Governor Hochul, Bill Clinton, in a radio interview recently, stressed the need for migrants to get work permits quickly as the clearest means to a solution. However necessary that might be, it ignores the fact the 40 percent of the city’s homeless population is employed.

Revoking the right to temporary housing will not make migrants disappear. Instead, it will leave them settling in public space, building the encampments that have unwound cities like Los Angeles and San Francisco, where there is no similar covenant guaranteeing shelter. It is hard to imagine who would prefer that outcome.