Yes to a certain extent it is against the law. People are so diverse. For example, if a landlord says a lot of single mothers live here...that would be saying a lot of single women with children live there. That compromises confidential information and can also be a possible safety hazard. If a landlord says a lot of seniors live here, that could be an indication that seniors are preferred and/or applications may be rejected for younger people/families.
Ask your landlord specific questions and if they are able to answer, they will. Also visit the complex at various hours of the day. Morning, noon, evening and night. This will definitely say a lot about the complex.
Wardley Real Estate