School is absolutely fine for learning what you need. Better than doing it by yourself.
The real problem is that it's
A) Necessary for certain jobs
B) Way too expensive. Making people decide to go autodidact
That's not enough information to tell you if it's a good investment or not. What would the next best alternative be? Unemployment? A 70k job? And remember that you didn't just lose 40k - you also lost the potential income you could be earning during those years. Assuming that job would earn you 40k/year of disposable income, and you went to college for five years, you actually forwent $240k, not just $40k.
How would you feel?