This is a tale about a poor boy that has the prospect to tour the most peculiar and remarkable candy factory. He roams around the spectacles of the factory, and gets to know that all this is a test of his character.
The passages in the mysterious factory, which should be Charlie's and our release from the oppression of the earlier scenes, are just as ugly as everything that's come before, so there's no contrast.
This is Gene Wilder's legacy. He was perfect for the role, and it was his mixture of childlike wonder and bitter, deserved vengeance that made the character so compelling.