Being that the movie was so different from the books, this question is a bit difficult to answer without at least -some- amount of speculation.
Some factual points to consider related to why Charlie's reprimand and 'punishment' came later (from the angle that possibly, their misdeeds weren't as severe as the other children's):
Charlie and Grandpa Joe consuming the Fizzy Lifting Drinks was based on curiosity alone
They were clearly taken and in awe by the idea of Fizzy Lifting Drinks (if the acting in the movie was any indication) and Grandpa Joe basically said, "A little sip won't hurt."
They didn't consume whole bottles between them but rather, did exactly as Grandpa Joe said - they took a sip and then everything started happening.
The possible consequence was dire - the whirring fan could have cut them to ribbons. Unlike the other children, however, Charlie and Grandpa Joe realized the consequences of their actions (curiosity almost kills the cats) and experienced remorse/guilt almost as soon as it happened. Additionally, again unlike the other children, they discovered a way out of the situation on their own - by burping.
On the other hand, the other children's intents in what they did were far less innocent. The consequences that came were therefore more severe and required the aid of the Oompa Loompas to get them back out.
Augustus Gloop was told to not drink from the chocolate river but did so anyways. He got sucked up and stuck in a pipe and sent to another part of the factory and the Oompa Loompas had to get him out.
Veruca Salt was told that she couldn't have a golden goose but proceeded to harass them and Mr. Wonka and demand one anyways. She stood herself on the scale that weighed for good and bad eggs and she was definitely a 'bad' egg and was thus sent down to the garbage chute. Again, Oompa Loompas had to get her back out.
Violet Beauregarde was told she couldn't eat the gum but she did anyways and was told to STOP once she started and she still didn't. She COULD have saved herself but didn't because she wouldn't listen to the second warning and again, she needed the Oompa Loompas to help her through.
Mike Teevee was told he couldn't use the Wonka Vision and like the rest of the kids, he, too ran in headfirst without any notions of the consequences and he simply 'punched it' himself and made himself travel through Wonka Vision. He shrunk and so had to be taken care of by the Ooompa Loompas, too.
Mr. Wonka needs an heir who will NOT ONLY listen to his advice... BUT TO ALSO continue his trend of creating and inventing wonderful candies and confections and THAT means he needs an heir who can innovate.
Charlie and his Grandpa Joe's curiosity could be seen as a sign of future innovation and unlike the other children, he exhibited more self control and an awareness of and appreciation of the dangers/consequences involved as a result of his curiosity. Additionally, he proved that he could creatively problem solve. Unlike the other children who ended up needing Oompa Loompas to get them out of their pickles, he and his grandpa were able to get themselves out of the situation with a little help from a matter of course (so much fizziness is bound to find its way out one way or another).
I would say that the movie portrayed both Charlie and Grandpa Joe as having matured a bit from their experience and when confronted by Mr. Wonka, Charlie seemed not only genuinely remorseful of what he had done, but he also returned the Everlasting Gobstopper to Mr. Wonka.
A possibility is this:
Mr. Wonka in his anger said, "You get NOTHING! You LOSE!"
Because he's Charlie Bucket and because he was willing to play by the rules (aside from the fact that curiosity got to the better of him), he was willing to accept that consequence - that he wouldn't go home with even an Everlasting Gobstopper as it was all or nothing.
And another possibility is this:
Charlie Bucket idolized Mr. Wonka and though his curiosity got to the better of him, he really respected the chocolatier and - at least in the books - he considered him a friend.
Knowing that Slugworth and his men were possibly going to try and re-negotiate with him re: Gobstopper (he was approached by the man in the hat when he got the ticket to make a deal... which he refused after speaking with his family who shared his same values), I would say that it wouldn't be unreasonable to suppose that Charlie might have simply given up the Gobstopper just simply BECAUSE he had no interest in capitalizing on his experience at the factory AT ALL.
Especially in the face of Grandpa Joe finally talking about giving the Gobstopper away to Slugworth after all, it was a way for Charlie to show Mr. Wonka exactly what kind of a person he was in the face of adversity.
Which leads to:
Basically, the at-the-end reprimand was a last test - of Charlie's TRUE character and motives.
He could have walked out with the Gobstopper and in his anger (like how Grandpa Joe was angry), decided to get revenge by selling the Gobstopper to 'Slugworth'... but he didn't.
For Charlie, he didn't need to win the contest; meeting Mr. Wonka and touring the factory was already enough and he already appreciated it. When reprimanded for something he shouldn't have done, he took it like a big boy and was still the better person in spite of it and when given the suggestion by his grandpa to surrender the Gobstopper to Slugworth to spite Wonka, he instead gave the Gobstopper BACK to Wonka.
Mr. Wonka was clearly impressed and it shows when he said, "So shines a good deed in a weary world."