Maybe there's a much less sinister reason for companies shying away from relocation. We had a few applicants that we were willing to offer relocation and all of them flipped at the last moment. They all said their significant others had a change of heart. I suspect the changes a relocation will bring, hits home really late.
Once bitten twice shy; I am not considering people who are not in my geographical area anymore.
You're absolutely not obliged to offer any relo to a programmer, any more than a Denny's is obliged to offer relo to a fry cook. This is completely within your rights. I truly mean it. You'll lose out on some candidates, but you may gain in other ways, and if the trade-off is worth it to you, that's absolutely your call.
My problem with employers isn't that they want to hire an unusually skilled person at what they've decided is "market rate", with no relocation. Or that they want to subject candidates to interviews amounting to intense all day (at times, multi-day) oral exam on undergraduate CS coursework, or that they don't want to hire anyone over 35.
What gets me peeved is when, after doing all this and discovering that they can't hire, they go to congress with claims of a "shortage", and congress actually believes it. This "shortage" is absolutely a self-inflicted wound, an outcome of all those things I described above. Software employers are not offering jobs that are competitive with what other industries are offering talented people. If that changes, you'll get your candidates. If not? Why on earth should the gov't create special programs to allow tech companies to bestow residency on workers (under conditions that limit the worker's personal freedom)? They can hire any of the 1.2 million immigrants who come to the US as free citizens able to choose their own path in life, just like in any other segment of the economy.
If an employer accepts this, then I have absolutely no problem with whatever salary they want to offer. If they can hire, hey, well done. If they can't, well, talented people are in demand, in software and elsewhere, that's how it goes.
You have provided a reason for not offering relocation. Not an explanation for offering a bad relocation deal. You and OP are talking about very different things.
If that was the case, why would you extend a job offer with a bad relocation deal rather than not offering the job at all? Are you hoping the applicant sees how bad your deal is and turns you down? Why wouldn't you just not make the offer?
Not really IMHO. If hcho's candidate leaves quickly after an expensive relocation, hcho's boss is not gonna like it ("come on, you made us spend 20k on relocation for this guy who ended up leaving after one month!"), while the pill will have a less bitter taste if the relocation cost is much cheaper.
Being in business is inherently risky. If that hypothetical employee leaves five years later, in the middle of a critical unfinished project that she's been holding together with her unique mix of skills and domain knowledge, it will cost the company much more than $20K. Or if the company hires a lesser-qualified candidate because they don't require relocation, that could also easily cost the company much more than $20K in the long term.
Also, an employee with a stable work history isn't likely to leave quickly after finding a new job unless (1) there's something terribly wrong with the company's culture or work environment, or (2) they've been lied to (e.g., told in their offer letter that they'd get fully-paid health insurance and four weeks of vacation, only to have them taken away a few months later by a "policy change").
Everything in a job offer is open to negotiation. Sometimes I have to go back to my boss to extend my range if I like a candidate a lot. If the candidate flips after that, the failure is much more public than I would like.