Or just offer both options. I certainly wouldn't eliminate the opportunity for unemployed people to get a little cash, just because of contract issues that gainfully employed people might have.
There are tax implications, for both employer and employee, to paying the candidate, at least in the UK. It would be quite a lot of headache for not a lot of money.
Donating to charity has tax implications for the company too, but they're much simpler.
I'm not a corporate accountant or anything, but I've been on both sides of this and it's very simple to pay people for outside work in the US.
And for that matter, giving real-but-unpaid work to do as part of an interview may be illegal. So paying for your time may be something companies are doing to protect themselves taxwise, not just for good will.