Massachusetts has more than 2 million buildings, and they are a major drag on the environment and the state government’s mission to reach net-zero emissions by 2050.