Massachusetts is a "right to shelter" state. This means that if you are eligible, typically, if you are a Massachusetts resident (there are dozens of different ways to prove that you live here) and you have children, you cannot by law be left out in the cold. Whether we have room in a shelter or have to pay for a hotel room, we'll make sure you sleep under a roof. There is only one other place quite like Massachusetts in this regard, and that's New York.
The Department of Housing and Community Development (DHCD), other state organizations and non--profits coordinate getting families off the street.
Unfortunately, we spend a great deal of money to provide emergency assistance. When shelters are overly full, we put people up in motel rooms (Days Inn, Holiday Inn, Howard Johnson, and Quality Inn are the most common participants). According to information gathered up in recent conversation, there are over 3,000 homeless families currently receiving "emergency assistance", 1,000 of which are in motels. The numbers have gone up and down over the years as we swing from caring to cost saving. The Commonwealth pays thousands of dollars per family per month for motel rooms and social services.
The solution to homelessness may remain out of reach. Certainly it requires a combination of prevention, temporary shelter, and "end game". Whether the "end game" is self-sufficiency or perpetual subsidy depends on each person's unique abilities (or disabilities).
Read more about motels here.