The simple reason for retribution is deterrence: there should be a negative incentive to committing crimes. The deeper reason is to make the kind of world people can live in. When everyone sees that criminals are punished, it tells would-be criminals to think twice, and it tells law-abiding citizens that someone is looking out for them.
I don't think punishment should be excessively cruel, prison is probably sufficient, and excessive solitary confinement is probably unjustified. But many people on this thread seem to think punishment in general is always unjust.
I think the underlying this is the modern belief that no-one is responsible for their actions, and that criminals are the product of social forces who need compassion and understanding. The argument against that is the standard argument against any form of determinism - if people are determined by outside forces, so are judges and prison guards, who similarly cannot help themselves from punishing criminals, and so should not face moral judgement. It's contradictory to judge judges but forgive criminals.