Often, when a home is foreclosed, damage is left behind. It could be deferred maintenance. It could be the former homeowner exacting a measure of revenge through frustration. It could be the delay between foreclosure and the time the property becomes available on the market. The owners [lenders] already are likely losing money. So, they almost always will sell 'as is' unless there are safety issues or permit issues that would prevent them from selling the property.
And since nobody wants to put money into a home they do not own, and financing damaged properties is not easy, one of the ways around this dilemma for primary residences is the use of the FHA 203k loan. The 203k is the section of the Housing Act. FHA is under the auspices of HUD. And references to this program can be found when looking at the government foreclosure website. The streamline program is the one discussed here.
From $5,000 to $35,000 can have the same financing terms as the sale price--96.5% of the repairs can be financed. No structural items like new garages, moving supporting walls, additions, etc. can be included. Firm bids are obtained from licensed contractors along with copies of licenses and sometimes references for the work to be done. Up to 50% of the total [not to exceed the materials portion of the estimate] can be disbursed at closing. The balance upon completion of the work. 60 days from closing is the time limit.
When buying a HUD foreclosure, detailed property information reports are provided. You shuld still have an inspection done. But some good bargains can be had out there. If you can look past the work that needs to be done.