The allegory on Ch. 16 of the sunlight shining on Pearl is actually a form of foreshadowing. Pearl, despite of her elfish and fiendish surreal nature, actually will have a bright future ahead of her. She will be the heiress of all of Chillingworth's money and she will be happily married, taken care for, and rich.
Since Pearl is an extension of Hester, she is both her punishment and her redemption. During these times when Pearl is little, and so close to the time of the sin being committed, she would be problematic to Hester. However, as Dimmesdale confessed the sin, a lifting happened where Pearl was "freed" from her nature.
Hester, however, was not. She had made the choice for the sin, Pearl didn't. Therefore, when the sun shone on Pearl, it was a sign that the light will shine upon Pearl, while Hester will continue her life as the person who wears the scarlett letter. Which, is exactly what happened.