Regardless, justice systems (incentives and accountability) and incarceration (incentives, and ideally rehabilitation) have nothing to do with free will. Any connection between free will (presence or absence) and the justice system seems to stems from some weird idea that it is about “punishing bad guys” or balancing some cosmic ledger. It is not. It is about controlling people just enough to ensure the long-term maintenance of society, as imperfect as our current implementation is. Look up Restorative Justice for approaches that focus on restorative outcomes for all involved, eschewing punishment and eye-for-eye thinking.
The cancerous cell does not carry any moral value; and neither does the immune system that destroys it. The cell infected by a virus is a victim of its circumstance, but that does not mean the immune system is should not destroy it.
If you accept a lack of free will, the solution does not need to immediately jump there but rather to finding a way that is fair to all to prevent the bad behavior thing from affecting others negatively while not locking someone up in a cage. There are many lines in between and some penal systems have adapted, but the US is way far behind there.
The optimization is no longer about revenge / punishment but about altering the scenario of the world to make everyone work together better. Sometimes people need to be fully separated from society, but not often. I think we do have effective behavior altering treatments, but they just aren't drugs and take time. But it's not a straight line from "it takes time to help people and its unreliable" to "we're giving up on finding a way for society to work with the people who did not choose what they are".
The question is if it's OK to adapt to the new landscape, or to consider it a crisis that needs to be solved.