I believe that early in the novel it is explained that Hester named her daughter Pearl as an allusion to a parable in the New Testament, which I quote here from Matthew 13:45-46 in the King James Bible:
45 Again, the kingdom of heaven is like unto a merchant man, seeking goodly pearls:
46 Who, when he had found one pearl of great price, went and sold all that he had, and bought it.
Hester has had to give up a great deal for the sake of her little girl, but she considers it worth the sacrifice because her daughter is so precious to her. The little girl does indeed seem like a pearl because she is beautiful and angelic. It is ironic that such a lovely child should be regarded as a source of shame and disgrace. She compensates with Hester for the ostracism and humiliation she has to endure, which is symbolized by the scarlet letter she is forced to wear.
A pearl is a gemstone characterized as rare, precious and valuable. It is the result of an irritant (namely, a grain of sand) entering the mantle of a living mollusk (typically, an oyster.) In essence, the oyster is taking something otherwise irritable and turning it into a thing of beauty and value. While Hester's clandestine relationship, once exposed through her pregnancy, is something that causes irritation and anger throughout the community, the arrival of her precious daughter Pearl brought her the joy that only a parent can understand. Pearl was her pride and joy, the beautiful thing that resulted despite her sin.