If you do bail them out, you teach other companies to think that "oh, it's okay to give credit out with ease" and if they fail, they can just have the government to bail them out. In the end, you'd still have the economic collapse due to others doing the same thing with the assurance that the government would just bail them out because they're "too big to fail".
On the other hand, if you let the collapse occur, you'd clean the market of its impurities, all the big companies will use fannie mae / freddie mac as an example that they shouldn't do xyz or else they'll fail miserably, so it's a win win after the collapse is over.
We as people learn from our mistakes, right?
Also, if we never bailed out companies and we rid ourselves of the federal reserve, we wouldn't have these bubbles in the first place.