Since a long time I try to educate companies to at least pay a symbolic sum to the engineer, like 10-20 USD/hour.
The reason companies don't do this is because they think that if the programmer fails, paying 100 USD for "nothing" is a waste (x). Most don't value the positive reputation and word of mouth this will generate. They just assume that if you're rejected they will never meet you again and after all you "agreed" to do a free homework task, so you are not supposed to be pissed.
(x) Paying recruitment agencies five figures however feels okay because it is somewhat linked to the success of contributing bringing a new person in.