Before Valley Place, Ms. Kelly, who has four young boys, spent time in what she called the “torturous” D.C. General Family Shelter: the city’s largest homeless facility, which houses hundreds of families. The mayor and City Council want to close the complex and replace it with more intimate shelters spread out across Washington. The city spends around $80,000 every night on hotel rooms for homeless families.

“People underestimate the degree to which housing is out of reach for certain people,” said Laura Zeilinger, the director of the Department of Human Services in Washington. She said her department had a commitment to make sure that families were safe and able to survive custody battles and violent homes, and that they were not “living in gas stations or McDonald’s or laundromats while we try to fix the system.”

In such a desirable real estate market, landlords are circumspect, taking government subsidies for affordable housing before screening out potential tenants for qualities associated with homelessness, Ms. Zeilinger said.

Often the last line of defense for those facing this kind of discrimination is the Washington Legal Clinic for the Homeless, where for 25 years Patty Mullahy Fugere has supervised a staff of lawyers who offer legal counsel on shelter and emergency resources to the homeless.

“There’s a bit of a double standard with the city that we’ve seen: We improve our schools, our roads. We put in bike lanes and dock parks and spent a lot of public money trying to attract outsiders,” she said. “It’s low-income residents who are drawn into the District who want to relocate here because there’s a stronger safety net to help them get back on their feet. Then for whatever reason, those folks seem to be demonized.”

“There’s enough of the renaissance for everyone,” Ms. Mullahy Fugere said.

Since her election in 2014, Mayor Muriel Bowser has made homelessness a higher priority than her more stringent predecessor did, extending the availability of shelters beyond the cold-weather months, when there is a threat of hypothermia. The survey pointed out that the Bowser administration had done especially well sheltering homeless children and veterans. In 2016, the city had the lowest percentage of unsheltered homeless among the study’s cities.