Companies do this for the simple reason that they can and so far they seem to have gotten away with it. Anyone applying for this sort of job should have the appropriate education and experience and/or portfolio and after personal interview(s) a company should be able to come to a hiring decision — yea or nay. Most companies have a “probationary” period where they can decide whether or not one is a good fit and let someone go who doesn’t fill the bill, the difference being that any work product would have been compensated.
It’s up to the applicants to indicate the inappropriateness of the request — by saying something like “What is the compensation for this project?” using the presumptive close attitude that there IS compensation. When told there isn’t any, say “Really?” in a tone of quiet astonishment with a raised eyebrow and add “I didn’t realize there were companies still doing this, given the class action suit.” After a few responses like this and a couple hurried phone calls to the legal and HR departments, the recruiter or hiring executive is going to have second thoughts about this sort of exploitation.