BOSTON — With temperatures starting to fall, nearly 4,500 families in Massachusetts remain homeless, part of seemingly intractable struggle for a place to call home.

It’s a problem made thornier by the state’s high housing costs, the lingering effects of the economic downturn, and a policy under which the state is obliged to find a place to stay for all those who are homeless.

Of the total number of homeless families in Massachusetts, about 3,250 are living in shelters, with 1,240 more placed in a network of hotels and motels scattered across the state.

That’s a decrease from the more than 4,800 homeless families a year ago – when nearly 2,000 lived in hotels and motels and more than 2,800 were housed in shelters.

The plight of the homeless also poses a political challenge to Gov. Charlie Baker.

As a candidate last year, the Republican said he would begin to eliminate the policy of placing families in hotels and motels during his first year in office and hoped to empty the hotels and motels by the end of his first term. During the campaign, Baker pointed to his experience as health and human services secretary under former Gov. William Weld.

“It took us a while to find suitable alternatives for people back in the ’90s and I wouldn’t expect it to be any different this time,” Baker said.

Baker said he wants to work with local housing authorities, community development corporations and other service providers to come up with an alternative to hotels, motels and shelters for families. He said it’s a goal shared by mayors, local officials and lawmakers.

A state audit released earlier this year found that putting homeless families in hotels and motels cost cities and towns more than $13 million each year in education costs and lost tax revenue.

In 2014, more than 1,700 homeless families occupied hotel or motel rooms during an average week.

To help spur the process, Baker this week named Linn Torto to head up the administration’s efforts to end family homelessness.

“Anything you can do to help somebody stay in the community where they have their supports, they have their roots, their kids go to school and all the rest, in the long run and in the short run, that’s the best solution,” Baker said.