It was all a while back, but I know I wasn't forking over that kind of coin when I was in college. Sheesh! Where on Earth were you attending?
I had a few minor undergrad scholarships that probably paid for my books about 1 semester out of the year. I worked 5 summer internships at 3 different companies. That managed to cover my in-state tuition and fees for fall semesters. I was definitely losing money each year during my undergrad, but I wasn't bleeding money. I was lucky to have been born into a family that could afford to get me though my undergrad, though. My wife and I got married shortly after we got our undergrad degrees.
At grad school, my wife and I turned a profit. I was a research assistant and she was an NSF fellow, both at top-flight engineering departments. As far as our masters degrees went, the experience was a very sour one. That had more to do with that particular university than masters programs in general (I hope). They had gotten top national ranking for several of their engineering programs and were more concerned about keeping that rank than any amount of damage inflicted on the students and faculty in the process. It was a bitter, hostile, and terrifying time. By the end, any idealism we may have had about academic research was gone. Far too many research programs seemed to exist only to perpetuate their own existence and contributed nothing of value to the nation that was funding them. There were around ten of us that were really close to each other at the time. We'd all planned on getting our Ph.Ds. In the end, only my wife and one other could stomach spending more time in academia, and both did so by returning to their undergrad universities.
When we went back to TAMU, I decided to skip the PhD entirely and just get out into industry. The "development" part of R&D is the part I always enjoyed the most anyway. I have not regretted that decision. I have worked as a design engineer for almost 9 year now at two firms. I am well compensated, and I have a good reputation in my industry (I'm always a little surprised by that, but I do actually meet people I've never met who know who I am. It is a little creepy, tbh).
My wife finished her PhD and goes up for tenure at the beginning of next year. She's still sour about research. She does more than the minimum required, but she hates doing it. She focuses most of her efforts on teaching and getting her department to up its game in getting the kids ready for real world engineering (i.e., train them how to think, not just look up valves on a table).
So, mixed bag, but all in all I loved my undergrad program, and I do not regret having gotten my masters degree, just where I got it. Since I've attended 4 different universities at various times, I can say with certainty that your experience (not to mention cash flow) will vary a LOT depending on where you go to school.