How Punishments in the Inferno are Adjusted for the Respective Sin

In the Inferno the punishments for each Circle at first may seem random. But when one truly considers the nature of the sin of that Circle, and the deeper meaning of the punishment, it is easy to discern that they are actually quite related.

1. The Area Outside of Hell
Those who are destined to exist outside of the official gates of Hell, but also outside of Purgatory or Heaven, are not committed to any one destination. This is because in life they could not commit to any one side. Among the "sinners" there are angels who did not decide to go with God or Satan definitively when Satan challenged God. They did not pick a side to belong to when it counted (good or evil) and so now they are punished by not belonging anywhere; an apropos punishment.

2. The Suicides
In the Seventh Circle of Hell are the Suicides, where all the sinners are in the form of trees. There are two aspects to their punishment, both relating to the fact that they decided to give up their own lives. One, while they are in Hell, they are not in their own bodies, instead forced to inhabit those of plants. Secondly, once Judgement Day comes, all the other sinners in Hell will be corporeally resurrected; but the suicides will not. Instead their bodies will be hung on their branches, a cruel reminder of the body (the "gift" from God) that they gave up when they killed themselves. This final part of their punishment is directly related to their sin; they chose to destroy their bodies, and so they will never get them back.

3. Count Ugolino
Count Ugolino is a sinner in the Ninth Circle, which is technically the Circle for traitors/treachery. Ugolino describes the sin that had him placed there, but his punishment seems rather strange; he is forced to forever chew on the neck of the man he betrayed, which does not really correspond to treachery. However, based on Ugolino's story, it appears to be implied that while he was still alive, Ugolino ate his dead children's bodies. If one takes this story to be true (even though it is terrible), then the punishment of forced cannibalism is not so out of place.