Bank of America, Wells Fargo, J.P. Morgan and Citigroup were ordered to revamp mortgage-lending practices.