A higher risk that one can avoid is fine. The problem with property insurance risk of living in a bad neighborhood is that you can't avoid it (otherwise you wouldn't be living there). Same reason why it is important to prohibit insurance companies from getting genetic information when issuing life or health insurance policies.
The whole point of insurance is to pool risks. Bans on redlining and genetic information gathering do not hurt insurance companies.