I teach Middle School, and can confirm wide awake's assessment. It may seem harsh that teachers do this, but when a particular student (or group) has gotten on your last nerve, it helps to unload a little in the lounge, even if the discussion starts as a way to help the student. My DS has pretty severe issues with transitions and I've put him in counseling not only to help him cope, but also to prevent his name being accompanied by eye-rolling in the lounge.
TupperMom also has a really good point to look beyond the behavior to the disrespect that it represents. I'm working on that with my own (precocious) 10 y/o DD - she's also very social and does not see why she gets reprimanded for something as innocuous as talking with her friends. I just spoke to her about the fact that it's not the talking that's getting her in trouble, but the disregard for the teacher's authority that leads her to presume that she can act against her teacher's instructions. Maybe it would help to approach it that way - sure, talking in class and having candy isn't such a big deal, but the disrespect is.
I'm concerned about the OP's school's policies. I'm very lucky to teach in a great school that values parental communication and input - we'd never have a student inform their parent(s) of a disciplinary action, but would call the parent within 5 minutes of the decision, preferably with the student still in the room to also talk to the parent about the behavior and its consequence. I suggest having administrators and teachers create - and sign - a written contract that delineates their goals for your daughter's behavior as well as the specific steps that will be taken if she fails to reach these goals. You and your daughter should sign as well, btw. Then everyone has a clear document and understands exactly what should happen.
I suspect I may be in the same boat with DD in a few years, so I'd love to hear how everything works out for you. Good luck.