Congress enacted legislation in 1994 to put this protection into law.
Here it is, in black and white:
11 U.S.C. 525 (c)(1) - Protection against discriminatory treatment
(c)(1) A governmental unit that operates a student grant or loan program and a person engaged in a business that includes the making of loans guaranteed or insured under a student loan program may not deny a student grant, loan, loan guarantee, or loan insurance to a person that is or has been a debtor under this title or a bankrupt or debtor under the Bankruptcy Act, or another person with whom the debtor or bankrupt has been associated, because the debtor or bankrupt is or has been a debtor under this title or a bankrupt or debtor under the Bankruptcy Act, has been insolvent before the commencement of a case under this title or during the pendency of the case but before the debtor is granted or denied a discharge, or has not paid a debt that is dischargeable in the case under this title or that was discharged under the Bankruptcy Act.
Hopefully this information will provide some comfort about paying for school after having filed for bankruptcy.