In my opinion, that statement isn't completely true.
Hugo wanted to say that people who don't go to school don't learn anything and end up in prison because they steal things for living. I believe there are jobs that don't require a high school diploma. For example, you barely need to read, write and do some algebra to be a garbage man.
In conclusion, who opens a school door may close a prison.