If the logic of punishment is to restore the imbalance that the criminal has caused through his crime, then one has to agree that there has been a fair balance between the distribution of benefits and burdens in the first place which is often not true.
However, if the crime has resulted in a more balanced distribution of socio-economic benefits, then the justification of punishment will transform into justification of crime. In such stage, punishment has no place as the crime has restored the balance and has moral justification.
Therefore, the perfect theory of punishment would only have justification in a perfectly balanced society in terms of socio-economic distribution. However, in a perfectly balanced society, there would be no need to commit crime for economic reasons.
Sadurski, W. (1988). Theory of Punishment, Social Justice, and Liberal Neutrality. Law and Philosophy, 7(3), 351-373. doi:10.2307/3504642