The problems came from three or four different directions: from the banks, from the rating agencies, from the government (mods: this won't get political), from the mortgage originators, and from the bottom-level mortgagees themselves.
In reverse order:
Because of the flood of people into desirable high-employment areas (Southern California, Vegas, NYC, Florida, etc.) the price of housing was increasing by several percentage points every year, for quite a long time, with little busts here and there, when a particular area got overbuilt. But generally, the trend was sharply up. So, you take the stripper in The Big Short. From her perspective, what she was doing made total sense: Say she scraped up a minimal downpayment on five houses and a condo (as in the movie) and put renters in them, with the renters covering her house payments. Let's say she paid $2 million for the six places. So you have a stripper, with minimal income, controlling $2 million in value, which depends totally on her collecting the rent so she can pay the mortgages. From her point of view, this makes total sense, because with houses going up 10% a year, if she can hold on for three years, and she then sells, she made more than $600,000 out of her minimal (or no) downpayment. The money appears like magic. What happens if her renters begin to leave, and she can't make payments? Then she walks -- what can you do to her? She's a stripper with no money. For her, it's essentially a no-lose proposition.
The mortgage originators write the mortgages, but the basic idea is that after you write them, you sell them on to a bank -- you don't keep them. So you have people hungry for houses that cost $300,000, $400,000, $500,000 and the prices are going up all the time. The mortgage originators are the two dumb guys in The Big Short who only knew sales, and who would sell to anyone. There was a lot of fraud here -- called liars loans -- given to people who in no way qualified for the loans. Not only that, the loan originators charged fees for getting the loan for them, and thus made money in two directions -- from the home buyers, and from the banks that bought the mortgages.
This is where the government came in. Because a lot of banks "red-lined" certain areas, based on income and (the government said) race, laws were passed to make it possible for low-income people to buy houses. The mortgage originators took advantage of those laws by offering to qualify people for loans, but often with higher interest rates than you'd get in the normal market. But the poor people weren't dumb either -- if they could get a loan and hang on for a few years, they could resell at the higher house value and "magic" the increase in money. The banks would accept those loans because of the laws that essentially required them to provide a certain amount of money for low-income housing.
The thing is, mortgages are usually considered very safe investments. With a big enough down payment, if the owner defaults, the bank takes the house. If the bank can sell the foreclosed house for the original purchase price, then they won't lose any money, because the original down payment soaks up the potential loss. (To over-simplify a bit, if you buy a $100,000 house with $10,000 down, you have a loan for $90,000. If you default, and the bank forecloses, and they can sell at the original $100,000, they've made the $10,000 on the original loan. But if the prices of the house has fallen, to say $75,000, and the owner walks away, the bank is then going to lose money on any resale.) But, since the Great Depression, the trend of house values had been steadily up. So, very little risk was seen in mortgages. Not only that, but mortgages usually paid a few (and sometimes several) percentage points more than other safe investments like state and federal bonds. So, mortgage bonds were considered quite desirable by many big investors, like retirement funds.
But what about those crappy mortgages? Well, you could make crappy mortgages safer by bundling them with really safe mortgages -- you'd get a thousand or more mortgages together, and bundle them into one bond, some of the mortgages very safe, and some crappy -- but overall the whole bundle should be pretty safe. So safe, in fact, that the bond rating agencies (Standard & Poors, Moodys and Fitch) routinely gave them the highest AAA ratings. The thing is, the rating agencies really didn't know anything about the quality of the mortgages in the bonds -- only what they were told by people who were trying to sell them.
The AAA ratings from the rating agencies assured investors that the bonds were safe, and so they were bought in huge numbers, because the buyers wanted that extra return.
Then, things got weird. The banks realized that they could cut the bundles (CDOs) into "tranches," which is a fancy French word for slices. They could take one of these bundles of mortgages and sell the riskiest tranche with a higher return, and the least risky tranche with a lower return. If large numbers of people began to default, and the bond could no longer be supported by the incoming mortgage money, the bond itself could go into default...except that since it had been sliced into tranches of different risk levels, the lowest (highest risk) tranche would default without affecting the higher-level tranches. This at the time seemed to be another safety valve...if only part of a bond defaulted, the higher levels would still be safe. But what happened when the housing market collapsed was that the lower tranches defaulted, but then the infection began to spread upward. What really caused the crisis is that eventually, nobody knew what the bonds were really worth -- how far the infection would spread. So then, nobody would buy the bonds, and if you needed to sell them, you couldn't, and the whole system began to freeze up.
Here come the banks. Because the banks were putting together thousands of these CDOs every month, they had to carry them on their books for a while before they'd resell them to other investors. So the banks might technically have billions of dollars of these things on their books, and...there were no buyers. Not only that, nobody knew what the value of the CDOs really were, how rotten they were. In fact, some of them were really quite stable, and some very smart people made a huge amount of money buying what turned out to be very good CDOs from banks desperate to raise money. Other, bad CDOs essentially fell apart.
Some people saw this happening -- saw how bad many of these CDOs actually were. Before the bonds hit the fan, you could actually make them theoretically even safer by buying insurance against their failure. This was real insurance, which is what got the huge insurance company AIG into desperate trouble; you could do the equivalent of buying home insurance on your neighbor's house, and if the neighbor's house burned down, you'd get paid, even though nothing at all happened to you (except that you'd have to pay the insurance premiums.) So AIG would sell billions of dollars in insurance against the failure of the bonds (even if you didn't own any) and collected a huge flood of premiums in a market they thought was perfectly safe. To go back to the house analogy, they thought they they were collecting fire-insurance premiums on a house made out of nothing but concrete. That's because all these CDOs were given the highest AAA ratings by the bond rating agencies. But when the bonds began to fail in large numbers, AIG and other insurance companies found themselves in desperate trouble: they'd collected billions in premiums, but were faced with paying hundreds of billions in losses.
Other people shorted the CDO market -- that's what the doctor was doing when he went to the bank and asked then to sell a hundred million in shorts. When you short a product, you essentially sell it at it's current value, even though you don't own it -- you simply are credited with the sale of $100,000,000, and that's credited to your account on the bank's books, but you don't get the money until you deliver the bonds. In return, you promise to deliver the bonds at a later date. What you're doing is expecting that you can buy the bonds at a later date at a lower price, and deliver them to the bank, and collect your original sale price. If the bonds drop 99%, for example, and you could buy what was once $100,000,000 in bonds for $1 million, you could then deliver those bonds to the bank and demand your $100,000,000. The bank would lose $99 million on the deal, and you'd win it. However, if you short the $100,000,000, and the value of the bonds continues to go UP, then you have a problem -- the bank wants its money protected, so if $100,000,000 in value increases to $110,000,000, you have to put up another $10,000,000, and if they go up to $120m, you have to put up another $10m. That's why the doctor was getting in trouble -- the banks were refusing to value the bonds at their real value, because they'd go bankrupt. So the value seemed to be drifting up, even as the doctor know they should be going down. Eventually, that game cracked, and the value of the bonds plummeted, and the Big Short came in.
There is a good deal of evidence that the prime money-pushers in this whole thing didn't see the trouble coming, and probably didn't do anything illegal. There was nothing illegal about CDOs, and the government acted within its own laws (which required a certain number of questionable mortgages be granted) and the insurance companies could insure whatever they wished, since we have free markets. The real actual fraud really occurred at the lower levels, with the liars loans and the fraudulent paperwork field by the loan originators -- but prosecuting these people would be like prosecuting car salesman who fib about their cars. Furthermore, there were hundreds of thousands of these people, in and out of the market, and they had no money so you couldn't fine them, and what are you going to do, put hundreds of thousands of people in jail while the bankers walk? But the bankers, by and large, didn't do anything obviously criminal under the laws that existed at that time...
So there we are. Whew.