The problem is that companies think they can get away with keeping people anchored to those starting salaries. It doesn't work; morale suffers and they leave.
Finding a young employee and turning him into one of your superstars is a really gratifying feeling. Watching him leave because obstinate business owners refuse to pay him what he is now worth is infuriating.
I've experienced this several times in leadership roles and it is one of the many things that convinced me to start my own business.
My girlfriend switched jobs after 18 months and got a 100% raise.
Shortly after I left, they put out a job posting for 7 people, each at more than I would have accepted to stay.
The job I left for was paying even more than that job posting, and I'm still here today.
So why did they do that? Why treat me fairly initially, then stop? They didn't really gain much. I was unhappy for 2 years and my job performance suffered for it. They replaced me with people who didn't have my knowledge of their systems, and they paid them more. It was absolute insanity.
[0] I left 5 months shy of my 10th service anniversary
Extrapolating from personal experience here as a programmer but it looks tough for a couple of reasons, one of which is pay. Employers tend to give very good starting salaries for experienced people, and very poor raises. So employees sign up inexperienced at low pay, get trained and get raises that put them below market rates, so their incentives tell them to do exactly the job hopping you describe.
Myself, I'd rather train someone up in my process without them learning bad habits, even if that means they're pairing with me for 30 hours out of 40. That said, I'm an exception.
Once upon a time, some companies hired new workers as QA, trained as QA, and those with the aptitude were moved into programming. I know that IBM still has an internship program that streams people into their system.