Job applicants being asked for Facebook username and password.

In the US, some employers are asking for Facebook usernames and passwords so they can check up on employee’s online profiles and what they get up. Hiding your FB profile or making it private may not be enough as employers are asking for username and passwords. Of course not having a FB profile would be one way of solving this issue. Obviously whether you would give over your details would be up to you and some potential employees might be happy to share – however others less so. But should you be asked at all? Is this illegal? I guess discriminating for refusing to give over passwords, but asking is unlikely to be illegal even though its an imposition for most employees.