EDIT: I didn't say this was just or right, just the current state.
In terms of regulations, I think by regulation they shouldn't be allowed to give the algorithms anything but loan amounts, payment schedules, and payment history. Don't give them locations. Don't give them age, name, race, or gender. Don't even give them the names of banks, since this too can be used in a discriminatory way that can be used to imply geographic location and thus race etc. Yes, people with no credit history will get terrible scores, but that's the point of a credit system. It should be based solely off of your merits and what you've actually done, not off of what people in your area/situation tend to do based on statistics. Then it's just statistics creating statistics, and socioeconomic mobility freezes
Getting loaned money is not a right, and if you are irresponsible, it's harmful.
So if lending more to a certain segment of the population hurts the bank's profit, I'd also expect it to cause more problems for that population segment too.