A representative for the Federal Reserve Bank of Boston has pointed to this specific statue in the U.S. Code as the law allowing for such a policy: United States Code: Title 15, 1691 (From the Equal Credit Opportunity Act):
§ 1691. Scope of prohibition
(a) Activities constituting discrimination
It shall be unlawful for any creditor to discriminate against any applicant, with respect to any aspect of a credit transaction—
(1) on the basis of race, color, religion, national origin, sex or marital status, or age (provided the applicant has the capacity to contract);
(2) because all or part of the applicant’s income derives from any public assistance program; or
(3) because the applicant has in good faith exercised any right under this chapter...
Furthermore, the representative shared, "[A]lthough discrimination based on income from public assistance is still generally prohibited, in the limited case of loan modification/loan forbearance, Fannie Mae announced in servicing guidelines (below) that it will not consider unemployment insurance benefits as part of income when evaluating loans for possible modification."
Borrower Income Eligibility for Mortgage Modifications
Servicing Guide, Part VII, Section 610.03.05: Verifying Borrower Income and Occupancy Status and Announcement SVC-2010-08: Updates to the Requirements for Evaluating Borrowers for Fannie Mae’s Standard Mortgage Modification
Fannie Mae's current guidelines allow for servicers to use unemployment income as a source for qualifying a borrower for a modification, including HAMP modifications. Fannie Mae is eliminating unemployment insurance benefits as an allowable source of income when evaluating a borrower for HAMP or any other modification. The servicer may no longer consider unemployment insurance benefits and any other temporary sources of income related to unemployment, such as severance payments, as part of the monthly gross income for mortgage loans being evaluated for a modification. This new requirement is effective November 1, 2010