I think it's fine to "teach prisoners coding" as along as the people involved are aware that to even get to that point, how much BASIC education has to be re-done or done for the first time. Moreover, things like resumes, job hunting, and relating to people in a work environment is something that these folks need to learn and practice. Most have never done that. I've not taught in prisons, but have done ABE (Adult Basic Ed, which is all but required for folks to get through before they can even start a GRE program, and which many parolees are required to enroll in).
In other words, "learning to code" is great, but instruction for literacy, numeracy, and socialization HAVE TO OCCUR before that's even considered, otherwise it's just a cruel pipe-dream.
We so lucky, most of us, to have grown up in an environment where learning achievement is expected and supported by responsible adults. Most of the incarcerated folks have lived a level of depravation that we can't even imagine.