Do you know how much value a high school type person has in writing computer programs for an actual software company? Something fairly negative. Say -$10 an hour or -$50 an hour, based on how much experienced person time they take up and how much damage they do.
If you run a small profitable business, even if you could get high schoolers to work for free to write you code, you should not do it. If you need to pay them minimum wage... even MORE reason not do it.
I feel this is a situation that other industries have dealt with for 100s of years. For example the day 1 statue carver was probably a huge negative value also. I suspect they had to sign something like "I will work for enough pay to feed myself for 2 years, and then work for a industry standard wage for 2 years after that if you agree to train me". So all in agreeing to 4 years of work for training. (And some pay, but not really break the bank pay). At the end of the 4 years, the company got a decent amount of value out of the statue carver, and the statue carver learned a bunch of skills without going to college.
Not really anything like this in programming. Not even sure it would be legally enforceable. But I think that is a big reason why there is a gap in needs of programmers vs people willing to train people to do the job. It really would suck for most people to train someone how to do a job for a year (losing tons of money), and then the person job hops to someone who pays higher and bears none of the training cost. This is why so many jobs advertise 1-3 years of experience required. They want people over the initial learning hump, but not making the big bucks yet.
So perhaps I am proposing a way to bring back bonded labor apprentices? Hum, seems terrible. But also seems like it could work...