A punishment for souls that do not immediately merit to enter gan eden (olam haba?) is to be flung about in the "kaf hakelah". What exactly is that? What is its purpose? Why specifically is that form of punishment used?
It's explained that even after passing away, he doesn't lose his "worldly" desires (or his thought, speech, or action in this world). Therefore, when he goes to Shamayim, those improper "clothes" remain attached to the soul, and the soul can't remove them.
Therefore, to break that klipa, the soul is thrown down into a world of imagination, where he imagines that he is still alive and does all those things which he did back in this world. However, in that world, one cannot remove those garments (unlike here, when one can arouse a love of Hashem even after doing business, etc.) and which results in great pain for the soul (it knows what G-dliness is, and wants to attach itself but can't). Then, as soon as the soul is used to this world again, it is either sent back up (which again causes great pain to the soul) or is moved in this world again to a different "location" (for example, if it loved one thing, the soul will start loving other things, which causes great pain).
The whole purpose of "Kaf Hakela" is to remove the dust from the Neshama, which represents Klipas Noga (which is not G-dly, yet is not forbidden) from the soul. Through being shaken up, he reaches a higher level and this "klipa" falls off from him (when the soul is placed into the world of klippa, and it wants to leave it. This desire removes his "worldly desires" from his soul.
Therefore, this doesn't atone for actual sins. To atone for that, one must go to actual Gehenom.
Also see Or Hatorah
Sefer HaIkkarim 4:33 explains it as follows:
A person who spends his whole life pursuing mitzvot and righteousness will find in the next world that all he knew in this life (i.e. the truth of Torah, the character gained from doing mitzvot) will be true, and now he will experience that truth as real. He describes it as a dream compared to reality. This world, we dream about truth, but...
יהנה בעולם הרוחני כאשר יהיה זך המחשבות והכונות מקרני האור השכלי המגיעים אליו בפעל הנקרא זיו השכינה
...when he gets to the Spiritual Plane, if he had pure thoughts and intentions, he will enjoy the radiance of intellectual light, which will reach him in actual reality [rather than as just an idea], and this is called the splendor of the Shechina
If a person didn't do this, however, then they will desire the delights of the splendor of the Shechina, because they are now able to appreciate and long for. Yet, it is too late. They try to climb up to the Shechina, but are unable to because they never learned (the truths, as ideas in the material plane) and therefore don't know how. On the other hand, they will still long for the physical activities and pleasures they habituated themselves to, and will experience the unimaginable pain of not having a means to do that.
This is the Kaf Hakela. The person is simultaneously drawn upwards but can't go, and drawn downwards and can't go, like a sling or a yoyo.