Also, remote workers can be more productive, since the average office is full of distractions. (I work with some very productive remote co-workers.)
Price for a week in the office in sf: $500-ish flight, 4 hotel nights $1100, $90 per diem $450, taxis/ubers $30/day = $2k - $2.5k. Throw in a $500 team lunch or two.
I agree remote workers can be more productive; I certainly was. However, I used most of those productivity gains to work fewer hours.
So long as there's an empty seat in the office, it really doesn't cost much to have someone sit there every day. Yeah, there are some free drinks but it's really in the noise and might well be dwarfed by some additional travel for the remotee to come into the office now and then.
However, at some point, having a significant number of remote workers may mean you don't take out a lease on an additional floor or move to a bigger building or construct a new campus, which can be huge costs.
The productivity debate has been done to death and I won't repeat it here :-)
EDIT: And from my experience, 30% of people work more productively remote, 40% about the same, 30% are less productive. That said, there are also productivity losses to in-office people when a smaller percentage work remote, especially if their jobs require frequent team interactions.
For developers it is certainly doable. For other teams it takes a lot of effort for everything to even out. Some companies have figured it out, some have not.
You chose to move, it's your responsibility to cover your travel expenses when you need to be in the office.
Now, if you already live in City B when the company hires you, or the company asked you to relocate to City B, then they should cover your travel expenses when you need to travel to City A.
Your choice to leave, your financial burden. Sure, you can negotiate this as if it were a raise, but be advised that most companies will then simply deny your request to move.