Even if free will is a myth and people aren't responsible for any of their actions, prison still makes sense for two purposes:
(1) deterrence is still possible even without free will, and
(2) it's important to remove potential repeat offenders from society so they don't have the opportunity to offend again.
The only aspect of the criminal justice system that it removes is the vindictive element-- it no longer makes sense to send people to prison to punish them and 'get back at' them, because they may not have been truly in control of their actions.