MA, particularly the Boston area has spent just shy of 400yr embracing micro-managerial busybody government at every level (several other New England states exist because living in MA was too onerous for various groups). Local governments have a lot of power. They use this power to implement self-serving bylaws and zoning rules that cause the cost of living to skyrocket relative to cities/towns that have more of a "you want to have an adult entertainment store two blocks from a high-school, ok fine, just don't forget to pay your taxes" attitude. It's a tragedy of the commons situation. Everyone wants to zone the strip mall, the lumber supplier, the mechanic and the big box store out of existence or relegate them to some small commercial area. Every town thinks their a special snowflake that should be able to embody picturesque New England town in Yankee magazine. Well actions have consequences and all those things all have to go somewhere and if every town makes doing business (or at least the kind of business that doesn't fit their vision) hard and expensive those costs get passed on down.
You can still be a homeowner, buy good groceries and keep your fridge full of beer on a single entry level tech salary in MA. The catch is you just have to do it in one of those "bad" cities like Worcester, Fall River or Fitchburg.
I welcome the SF problems in the Boston area.. You reap what you sew.