For the most part, the banks were not as agressive in the subprime lending market- certainly not at the outset. There were a lot of private mortgage companies that booked loans and then resold them to investment companies or yes, banks. They got their money up front and weren't that concerned about the lower quality of papers they were issuing. The loan repurchasers often put together packages of mortgages and then resold them to somebody else as securities backed by the mortgages. These packages were often bunches of different types of mortgages to spread the risks around. The securites with higher risk notes backing them should have offered higher rates of return and that made them more attractive to buyers who thougt the market would continue to boom.
People buying these packages were offered a higher possible rate of return by taking on the risks- but found later that the risks were much higher than they were led to believe and that is why the financing collapsed. All the repackaging and reselling led to reduced ability to judge the quality until nobody wanted to buy any of the mortgages or mortgage backed bonds.
Fannie Mae and Freddy Mac do have limits on the size of loans they will guarantee. In some places like Southern California, they would not cover even the median loan since the price of the median home rose to above their maximum levels.
http://www.fanniemae.com/aboutfm/loanlimits.jhtml In San Diego the median housing price was as high as $517,000 and even at the latest figure of $430k exceeds the Fannie Mae maximum of $417,000.
I agree that housing is not a truely free market, but my point was simply that the prices were responding in a free market fashion to more money becoming more easily available for the purchase of homes- a combination of historically low interest rates and looser lending practices and creative financing- which led to greater demand and thus higher prices. The market responded by trying to increase the supply of housing stocks but some came too late and now there is excess supply relative to demand and housing prices are making a very rare retreat in asking prices.
I would heartily agree with anyone who opposes bailing out either individuals or banks or investment firms who lost money by being involved in the housing market- they accepted the risks and should pay the price if things go wrong. Bailing them out (as the previous poster rightly says) would only encourage more risky behavior in the future.