The "flaws of the Secondary Mortgage Market" that Congress has tried to unsuccessfully "fix" over the last 12+ years, is the fundamental problem that financial intermediaries don't want your 30 year PREPAYABLE FRM sitting on their books.
The only significant risk the gses have now is Credit Risk on $6.6 Trillion of US home loans. The UMBS was created for that hazardous day when Congress gives the green light to stamp a "Government Guarantee" on it and open the flood gates for the tbtf banks and other financial intermediaries to issue UMBS and take a "piece of the action" from the gses.
This is the dream of MC and most "free market" R's. The problem is, under Greenspan (a Libertarian), they incorrectly assumed that the "free market" knows best, and that's why the Federal Reserve turned a blind eye (and apparently encouraged) to the proliferation of the Private Label Security MBS that the gses had to mop up on their books during the Great Financial Crisis. This is also why they are likely the last unfinished business of the GFC.
During the last 12+ years, while Congess debated how to fix this system, a Georgetown University law professor did a great paper on the US and world history of mortgage securitization and testified to the Senate Banking Committee (Professor Levine?) around 2011/12.
The only time mortgage securitization worked was with a former German system that was apparently very draconian in their underwriting criteria and heavy hand of a regulator. ALL OTHER TIMES IT FAILED with the corresponding difficult results.
The problem: When financial intermediaries compete with each other on issuing MBS, there is an inevitable race to the bottom in both loan quality and price, aggravating the already cyclical nature of real estate booms and busts.