Knowingly issuing a fraudulent mortgage (e.g. a mortgage based on false information) is fraud. It is the sort of thing that you can go to jail for, especially when it is done on a mass scale, as was the case in the financial crisis. Knowingly passing along fraudulent mortgages in mortgage backed securities is also fraud.
No important figure at any major bank was prosecuted for these activities by the Justice Department. As a result, virtually all of them benefited from their actions in the housing bubble years. They were better off as a result of having committed fraud than if they had obeyed the law. Economic theory tells us that we should expect that this would lead other executives in similar positions to act the same way. In other words, they will break the law, since the consequences of getting caught are essentially zero.
In spite of this reality, in an article on a Justice Department investigation of loan practice in the subprime auto loan market the NYT told readers:
"For the Justice Department, buffeted by criticism for not indicting a Wall Street executive, the mortgage investigations have helped polish the agency’s image as a tough enforcer as they have yielded a string of multibillion dollar penalties."
The article doesn't tell readers in whose mind the Justice Department's image has been polished. The recent settlements against banks can be seen as taking actions against a mob run company after the mob has sold it off, while all the mobsters continue to go free and live off the proceeds of their illegal dealings. That may seem tough to some people, but probably not anyone who has given the issue much attention.
Note: Typo corrected.