In the U.S., it is an illegal practice in the context of lending.
It's also leads to really ridiculous situations. For example, living in Brooklyn, NY made it impossible to rent a car in the 90s without an existing relationship with a rental agency. Living in a black neighborhood made it impossible to get a mortgage.
I'm aware that we have a multitude of (often confused and nonsensical) laws, which in some cases force businesses to ignore data and make bad decisions.
My question; what argument can you make in favor of enacting such laws if they didn't exist? And if you make such an argument, does it also imply that small females should ignore the fact that Delhi is the rape capital of India? Or that pizza shops should put their drivers in danger of robbery?
In NYC, a decision was made and actions taken to improve the safety and security of the environment so that a woman can safely walk the streets unmolested.