Yes, hiring and training is expensive... and the loss of domain knowledge is costly too.
There are a lot of places that aren't making that much money to be able to get to "market rate".
I'd also like to put forth that the idea of a market rate for developers across all industries is one of the things making it hard to find developers. There are more than a few new grads out there that are discounting any job that pays less than $100k/y because they believe that the market rate is that and anything less is being underpaid regardless of industry, company maturity, or locale.
I think it's always important to keep in mind that current developer salaries are the result of a constrained market and not because we innately deserve it or something. Yes it is a high-skill job, but there are plenty of high-skill jobs out there that pay much less.
I spent the first twenty years of my career as a public school teacher, and the last four as a software engineer.
Most of the teachers I knew worked _literally_ twice as hard as the average software engineer I know now, even though they're paid one third as much.
And finding good teachers is just as difficult as finding good ICs. I think the ONLY difference is that it is possible for a lot more people to teach badly than to code badly. And of course that society has decided that teachers aren't worth paying very much.
I was reasonably paid for the area. Sure, I could have been making more if I was to go to a different company (challenging in '09). I'm making more now for a different employer in the midwest.
The thing is that there are companies that don't make $100k/y revenue for the work that the devs do. There are also devs who are willing to work for $50k/y in the rural midwest (which is better than other jobs in the area pay).
To assume that those devs should be paid the same as one in SF would have ultimately meant a loss of jobs in the area as the business wouldn't be able to afford to do that.
There are plenty of places that are not the mid west that are paying more.