You need to empathize with her pain and let her know that you understand why she feels sad and hurt. Don't suggest that this incident shouldn't matter to her, as this will tell her that you are incapable of understanding her and what is important to her. State her pain, empathize with her and say something like, "I bet you're feeling pretty sad not to have received any carnations from your friends, right?" That should be the start of a conversation that seeks to comfort her and to put this incident into perspective. You might even weave in some similar disappointment from your childhood to make her seem less singled out.
Offer practical reasons why some of her friends didn't get her a carnation -- they didn't have enough money to buy everyone a flower, maybe some friends didn't give flowers to any friends in her circle, etc. Reassure her that she should not equate not receiving a carnation with the loss of anyone's friendship. See if this discussion reveals any concerns that this is just another example of her losing her friends, of them ignoring her, of no one liking her, etc. Find out whether this incident meant a lot more to her because it was one of many recent events signaling your daughter's increasing lack of friends.
I dislike these fund-raisers because they reinforce the chasm between the haves and the have-nots at an incredibly vulnerable stage in the emotional life of an adolescent. Adults should know better than to feed into all this insecurity and choose another way to raise some money. How about kids buying flowers or making valentines for kids and elders who are in nursing homes, shelters, or hospitals? Why not suggest that idea for next year?