One possible way for it to happen is if a student's parents have a high income, are unwilling to pay for the student's education and force the student to shoulder the financial burden, and the student does not argue his/her case to the financial aid office. Another possible way is if the family has a relatively high pre-existing net worth, but low income, and is unwilling to spend the income, and again the student shoulders the debt.
I'm in my 30s-40s - was entering college before need-blind was a thing. It absolutely happens.
It's just usually not the case that you'll graduate with hundreds of thousands of dollars of debt, at least these days. It's quite rare IIRC among students receiving financial aid to graduate with more than several thousand dollars of debt from an Ivy over four years, and if you go back several decades I'm fairly certain those numbers go up, but I'd be rather shocked if they went up by more than an order of magnitude.
The OP got really screwed by the Singaporean situation, where if you don't fulfill the post-graduation government work posting obligations, the Singaporean government will claw back all the money it gave you for college plus interest.
Tuition alone is $50k/yr, which would equate to $250k for a 4-year degree not accounting for living costs. Even at 50% off the sticker price, you're looking at over $125k in debt upon graduation.
You may want to reassess your understanding of middle class.
i may be book smart but ive made some colossal screwups in my life.