We originally moved to Boston to be close to universities. It seemed like a better location for convincing our professors to use the edtech product we'd started with.
We made the move back to SF to be closer to our customers (since we had shifted to building an analytics product by then). It was much easier to walk them through the product in-person.
I wouldn't say this is strictly necessary today, but SF does have a nice density of startups if you are building a developer tool.