Bread can easily provide enough proteins at a very low cost, if its quantity is large enough (e.g. 500 g of wheat flour per day) and if it is supplemented with a small quantity of another food that can provide enough lysine, e.g. beans or meat or dairy.
The problem of getting proteins mostly from bread is that you also need to do enough physical activity to avoid gaining weight. This is a serious difficulty for a computer programmer, but it is unlikely to be a problem for a prisoner or for a manual worker.
It is likely that at least in a country like USA, the ratios for prisoners have an adequate protein content, even if they may be not tasty.
In countries where prisoners were treated less well, for instance in the Eastern Europe countries occupied by the Russians after WWII, where the political adversaries of the communists have been either killed or jailed, the prisoners who have survived their prison term were really stick figures at the return from prison, so your images about prisoners must be biased by the US prisons.
In the Hollywood movies, many prisoners look like boxing competitors, but in many countries you will never see such well-fed prisoners.
Because I suspect they don't have a diet with protein powder.