Actually it is not punishment it was a challenge for salim, which he accomplishes successfully. He was not guven punishment for unintensionally hurting a boy, he was given punishment for running from that place. When he saw the boy falling from the tree and screaming, he must come forward to help that guy. But he runs, just like when a person do accident he runs from that place without helping the injured.
His second mistake was that he lied him in front all people, which shakes their image, its not only akbar but more to salim. Akbar wants salim to be respected among people, what will people think about him, that he will be future shehansha.
Atthat place salim learned the life of common people, how they survive, how they earn their livelihood, he learns:
1) how to arrange woods, how to cut woods.
He learns how to cook food
How to fulfill responsibility.
These are some very basic things, but it gives u strength and confidence in u.