I've just seen this on Reddit from SO user Cletus. He cites a couple of articles that claim that charging candidates is illegal in the United Arab Emirates and in Australia.
So I did a bit of searching and the pages I found seem to suggest that it is illegal in South Africa and the UK as well. It also appears to be widely regarded as unethical, even where it is not illegal.
Now I don't know whether StackOverflow would meet the definition of a recruitment agency under these laws, but it's probably worthwhile for Joel and Jeff to find out. If they don't want to drop the fees for candidates it would perhaps be sensible to do some geolocation and block access to the service in locations were it might be illegal, and to refund fees to anybody from these locations who has already paid, in order to minimise any potential liability.
EDIT: I've found the relevant section of UK law: The Employment Agencies Act 1973, chapter 35, section 6:
Restriction on charging persons seeking employment, etc
Except in such cases or classes of case as the Secretary of State may prescribe, a person carrying on an employment agency or an employment business shall not demand or directly or indirectly receive from any person any fee for finding him employment or for seeking to find him employment.
Any person who contravenes this section shall be guilty of an offence and liable on summary conviction to a fine not exceeding [F1level 5 on the standard scale].
Level 5 on the standard scale is a fine of £5000.
EDIT 2: The definition of an employment agency as per section 13 of the same act:
For the purposes of this Act “employment agency” means the business (whether or not carried on with a view to profit and whether or not carried on in conjunction with any other business) of providing services (whether by the provision of information or otherwise) for the purpose of finding workers employment with employers or of supplying employers with workers for employment by them.
Of course, I am not a lawyer and don't actually know what I'm talking about so you should not rely on me for legal advice.