If we’re all automatons, there’s no _point_ in prison, but it also doesn’t matter.
It’s just something we (automatically) place certain people in so they don’t (automatically) perform actions that society as a whole (automatically) disagrees with.
But there’s no point arguing it because in your hypothetical free will-less world we don’t have a choice in the matter. But also we might argue it anyway because we don’t have a choice not to :)