But the possibility of punishment certainly factors into an individual's choice, whether the choices is considered to be "free will" or not. Even if people have no free will, punishment as a deterrent could still be effective - it could still influence the "algorithm" that brains (lacking free will) use to choose their actions.