How did sub-prime lending hurt the economy?

Sub-prime lending resulted in many banks receiving federal aid. To pay for this the government took several loans from itself, weakening the value of the dollar. How does that harm the economy?