When you're working a double shift to put food on the table, it's really hard to learn an extra skill set (e.g. programming) and make time to build up a resume on github (or whatever).
The cost isn't really located in the act of "buying" education.
That said, making good decisions isn't sufficient, especially when you're trying to claw your way out of deep poverty.
You need more than just hard word. You need the opportunity to do the right kind of hard work, which many people lack.
Not everyone is going to be able to find a well-paying tech job. How many times have you come onto this forum seeing active HNers who are tech-literate and have a history of programming employment complain that they cannot find a job?
Look at your neighbors.. everyday people like your grocer or mechanic or mailperson.. Take a look outside your bubble. Not everyone is going to be able to be fluent in tech even with great effort. It's not so much that it's impossible, but that's it's incredibly unrealistic.
The only reason I've been able to work as a programmer is because I lucked into it. I got hooked when I was 12 or so because I found it fun. I had plenty of time and enjoyed it. If I had to do it all over today out of desperation I'm not sure I could will myself to do something completely foreign and uninteresting.
I think you take for granted the knowledge foundation that you were given.