On the surface, the connection between the foreclosure crisis and lack of affordable housing may seem weak.