We do have apprenticeships in programming, we just don't call it that name. You start out at the bottom of the ladder and more senior people help you learn. Most medium and sized and bigger companies have some variation of that. Sure you can start as the only programmer in a small company and thus not get mentored, but you still learn on the job like an apprentice.
They are useful in that they at least convey a tiny bare minimum level of skill--something many, many software engineering candidates lack. Passing the bar exam for lawyers and the medical board exam for doctors signals at least some minimal knowledge and qualification. They don't tell you the professional's whole story, but enough to allow you to skip the "Where is the patient's knee?" interview questions.
Software desperately need at least some "barest minimum" gate that lets interviewers at least skip the Fizzbuzz questions.
Still, if I need someone who knows Linux, something like a current RHCE tells me they have at least some minimal level of competency. (Certs seem to be more of a thing for sysadmin knowledge than general programming however.)
To the larger point: I'm very much in favor of hiring junior developers, but there's a limit - I find you need at least 2-3 mid+ developers for each junior, ideally at least one senior/staff per if you want to do a good job of mentoring and development at the same time. Since the industry has grown exponentially, it's impossible to hire proportionally to applicants and maintain this ratio.
I am counting down the days until our recent senior hire is fully onboarded and comfortable and we can open a junior position again.