Symbolism, Imagery, Allegory
Think of all the positive things you might associate with candy and apply it to the relationship between Mr. Pirzada and our girl-narrator Lilia. That's kind of what the candy represents: an exchange or token of affection from Mr. Pirzada to Lilia.
It's also Mr. Pirzada's way of recognizing that Lilia's a good kid: "I only spoil children who are incapable of spoiling" (WMPCTD 23) he tells Lilia's parents.
That's why Lilia treasures Mr. Pirzada's candy way more than the candy she gets from trick-or-treating on Halloween. Mr. P's candy is a gift meant to make Lilia feel good about herself—like she's worthy of candy just because of who she is. She doesn't need to do anything for it; she doesn't need to dress up in a costume and go asking for candy.
In other words, Mr. Pirzada's candy is the best gift of all. It's a pure gift that asks for nothing in return, not even a "thank you" (WMPCTD 24).
Of course, because Mr. Pirzada is so sweet for giving Lilia so much candy, Lilia ends up feeling this deep affection for this man anyway, this man who, by the way, is almost more like a father to her than her own father. She "covet[s] each evening's treasure as [she] would a jewel, or a coin from a buried kingdom, and [she] would place it in a small keepsake box made of carved sandalwood beside [her] bed" (WMPCTD 25).
Totally typical of a kid, right? She doesn't even eat the candy because by this point, the candy's become something else: it's a metaphor for this unspoken love she feels for Mr. Pirzada even though he doesn't exactly feel the same way. (After all, he does have his own daughters to whom he returns.)
Which is why, when Lilia throws her candy away at the end of the story, it's pretty much like a spurned lover throwing away all mementos that remind her of the guy.
By the way, if that whole "spurned lover" thing makes you feel uncomfortable, you're not alone. Read too much into this whole candy business and it might feel a little…well…uncomfortable, kind of how Lilia feels when she's around Mr. Pirzada: "I was charmed by Mr. Pirzada's rotund elegance, and flattered by the faint theatricality of his attentions, yet unsettled by the superb ease of his gestures, which made me feel, for an instant, like a stranger in my own home" (WMPCTD 24).
But that weird feeling exists because there isn't a name for the kind of relationship Mr. P and Lilia have. Candy, in this case, is a superficial metaphor for Lilia's feelings. It can't come close to acting as a real symbol of Lilia's affection/obsession for Mr. P and his family—another reason why Lilia tosses the candy away once she learns Mr. P's back with his family.
Way deep for something that's just full of empty calories.