Is it ethical for government to ban the practice of banks to refuse loans to people who they consider a “risky investment” because of their location?
If the banks are refusing to lend to people based on the actual risk associated with the place where the people live, then government should not intervene. A bank is well within its rights, for example, to decline to finance a home purchase if the home is in an area where housing prices might be likely to fall due to high crime rates. In such cases, it is not right for the government to ban this practice.
However, this practice often becomes "redlining," where banks simply refuse to lend money to members of racial minorities, using the excuse that they live in a risky area. If this is the case, government intervention is ethical and desirable.
So, as long as the assessment of risk is being made on objective and relevant factors, government intervention is not ethical. If the assessment is being made solely on race or ethnicity, intervention is ethical.