Here in Oregon, most management companies require personnel to live on-site as a condition of employment. I don't think they would be able to do this if it were not legal. They don't do it for any discriminatory reason. If there is a fire or similar emergency, it's very important to be close by. I've also seen other companies that also require their employees to live within a short time or distance away.
The best thing to do is check the law where the position is located.