It's not so simple.
Why do we have education?
Firstly, because there's needed some way to filter people. If you get 100 applicants, you can't make a detailed consideration. But if only 30 have degrees, it's much easier. So there is a signalling effect.
But secondly, and more importantly, because you need somewhere to have these kids. If there's ten million jobs and ten million two hundred thousand jobs, you'll get problems. This is also why many countries had military service, to further improve on the unemployment figures.
"We didn't raise [the school leaving age] to enable them to learn more! We raised it to keep teenagers off the job market and hold down the unemployment figures."
Prison is just a logical extension of this. If they weren't in prison, they would be unemployed and causing all sorts of trouble.