Gov. Charlie Baker signed legislation spreading $626 million around the economy over the next five years and making it easier to build new housing, an area where Massachusetts has lagged behind other states.