I think it depends on the way it is asked. If the potential employer says, "Are there any obstacles to you being in this location to do this job?" that is OK, but if it is "Do you need a job for a partner/spouse?" then it is not OK. What did they say exactly? And even if it just falls in the impolite category, then that is information too--it won't get better after the job market, just worse.