> you broke a written rule and you spend some time for it.
Not true. Jail is for people accused of breaking rules, not convicted. And arrests are severely biased against certain subpopulations.
> The judge gives you rules and you follow them and you get out.
which generally involve sitting in jail because you can't afford bail, with a nontrivial chance of losing your job due to absence, then losing your home due to poverty.
Don't argue which injustice is worse. Fight the injustice.