I have always thought that there is a reason (or can be, depending). When the capital city is also the largest city, the rest of the state can often be ignored (a complaint from many about Boston, for example). If the capital is outside of the major cities then the government can better focus on the state as a whole without getting involved in local politics (think Albany vs New York City).
Also, often capitals are moved outside of major cities due to population and infrastructure, as sometimes larger cities can't sustain any more growth (which is what happened to Malaysia).
San Francisco has interestingly never been a contender for the capital, as before Sacramento it was Monterey (and Benicia and Vallejo but those were just stints). And if it were, the odds of the State focusing on the Bay Area before anywhere else could indeed become an issue.