How can we bridge the gap between the lack of supply in programmers in relation to future demand?

I’ve read many articles warning us about the lack of supply in the workforce in relation to the demand in technology/programming jobs, especially ones showing the unbalanced ratio with future prospects. And then… I constantly hear and read about how hard it is to actually land a job in these fields (eg. employers wanting 3–5 years experience from recent grads).

Obviously, every employer wants to hire the most competent people they can find and don’t simply take many chances on “but I’m willing to learn” students. But if tomorrow’s job market requires more workers in these tech fields, why is today’s job market so hard to penetrate?

Internships allow students to gather real-world experience and give employers the chance to realize if you’re fit for the job or at least have the ability to develop the skills required for their respective company needs.

I won’t say there aren’t enough resources online to self-teach oneself because there definitely are, and students should make an effort to expand on what they learn in and outside of class. But shouldn’t we facilitate the process by providing widespread practical learning environments that imitate internships, or even further, the day to day technical operations within organizations?

Wouldn’t it be beneficial for students, employers, and the economy in general, if the government used a portion of our tax dollars to subsidize learning spaces that focus on the practical application of company operations? What if we could have mentors working in these spaces, giving the students relevant tasks to tackle and provide supervision/assistance in order to help them develop the problem-solving skills these hard-to-impress-employers are seeking.

Of course, then the question is how much time would this take away from students who are already performing school work and/or working jobs. Perhaps it could be set as a lab-like activity for students, lasting a certain amount of hours per week with the incentive being the more hours you gain the more experience to showcase future employers. Or, it could also be made available to non-college students who have self-taught themselves the foundations of programming knowledge, possibly making for a full eight hour work day session. We could assume a basic pricing model for maintenance costs, whereas for college students it could be included in their tuition.

Ultimately, my main concern is this:
Is the lack of supply in programmers simply due to low enrollment in tech related fields, or is it because we aren’t doing enough to facilitate the learning process and help people develop the necessary skills?