The Fair Housing Act of 1968 had made it illegal for real estate agents and banks to discriminate against homeowners on the basis of race. Red-lining emerged as a subtle way to continue this discrimination, by declaring, certain neighborhoods as unfit to invest in. By 1977, the results of this practice were becoming too obvious, so Congress stepped and gave lenders a choice: if you want the FDIC to insure your deposits, STOP the redlining.
The CRA didn't force lenders to make riskier loans. It required they take each applicant on his own merits and give people in poorer neighborhoods the same chance at a mortgage that everybody else in town was getting. It wasn't about preferential treatment. It was about equality.