Jury nullification: Discrimination in some form or another plays such a large role in who goes to prison that we actually have a term in th U.S. for the process of trying to combat it with what amounts to legal civil disobedience.
When a regime falls: I have heard it said that when a regime falls, the first thing that gets done is to release all the prisoners. Why? Because being in prison isn't about being a bad person. It is about violating the rules.
I knew a man for a time who went to prison in his youth for his political activism. He was extremely idealistic. Like me, he was prone to being too honest for his own good. He was very clear that laws are written by humans and there is nothing inherently moral about them. They are, at best, only as wise and moral as the authors. Unfortunately, in most cases they are less wise and moral than that since getting passed at all may involve politicking and compromise. And in many case they are writen with no intent to be "fair" (such as Jim Crow laws).
Best of luck in coming to some meaningful, informed conclusions.