And the problem you pose is easily solvable. They have to re-apply for loans every school year. Maybe pretty much everyone gets funding freshman year before they declare, but when they re-apply for sophomore year their major is taken into account. If you switch majors mid-year, then when you re-apply the following year, you get evaluated. Or if you received funding for a given year, you are not allowed to switch your major during that year.
EDIT: It's really not all that different than home loans being determined by income, credit history, etc. If you are going to ask for a $500k home loan, you better have the income to pay it back. If you are going to ask for a $100k student loan, you better have the projected/expected future income to pay it back.