There are a lot of jobs going around these days. Employers no longer have the luxury to treat prospective hires poorly. This is the employer's problem, not the candidates.
Personally, I've asked potential hires for work product demonstrations. However, two crucial differences: 1) I paid them for their time, and 2) the task was on a real part of our infrastructure, the code they produced eventually being used in production. Everyone was happy with this situation.