San Francisco is an interesting study in stadiums. The baseball park redeveloped a run down, formerly industrial neighborhood not far from downtown (the Financial District, as we all it), and has added a ton of value to the City, in part because of the baseball attraction there. Now it incorporates a lot more, including a huge health campus and the Warriors stadium, too, neither of which likely would have happened without the ball park.
But the Board of Supervisors miscalculated the 49ers desire for a new stadium, which is why that team moved so far south. My understanding is the ownership wanted to stay in the City, but weren't willing to be held hostage by the Board of Supes. When the latter drove an unrealistic bargain, the team was willing to accept a good deal from Santa Clara (which, by the way, the City of Santa Clara has largely regretted ever since, probably because it didn't lead to the economic development Santa Clara hoped for).
The City of San Francisco underestimated with the 49ers knew: that team is a regional team, not just the City's team. Moving its stadium to Santa Clara didn't cost it many fans because the Bay Area, at large, is 49ers country (outside of the people who were Raiders fans in the East Bay).