And the for the case of punishing past crimes:
you can inflict negative utility on someone who earlier inflicted negative utility on others in the past, but the former will not prevent the latter.
I suppose you oppose that too?
There's no point in punishing a (past) undesirable act if nobody who could potentially commit that act is going to become aware of the punishment you inflicted.
Prisons are only a deterrent if people know that they exist.
Here's an edited version of a puzzle from the book "Chuck Klosterman four" by Chuck Klosterman.
When should you punish someone for a crime they will commit in the future? Discuss.