S.,
This may be the end of things-- having lunch in the principals office and crying--sounds like he might have already learned his lesson. Think about it-- he was called out in front of peers and this sort of in-school discipline is something that gets a LOT of social attention.
If it were my kid, well, I think I would let it end there. Just a talk in private with you and Dad may very likely be enough. I'd check and see if he's just getting carried away with his friend, and then give good advice:"Just because he is doing this silly thing doesn't mean you should." And then, I'd hold any further punishment-- I would, however, make it clear that if I got another call from the teacher or principal for his behavior that there would be a serious consequence. Maybe it's writing a letter of apology to the teacher for disrupting the class, if that's the case, or doing extra chores. Flinging food? Maybe having kitchen duties for a few days with you might be instructive as to *why* it's messy and why we don't act like animals and leave a mess for others.
But for today, my guess is that he's pretty humiliated. Convey your disappointment because "we know you know how to behave in school and we expect good behavior at school" and then let him know that the next time, there will be a really un-fun consequence. I think humiliation is a great teacher, and as mad as I, too, would be, I wouldn't impose the kind of punishment that makes him focus his upset and anger on you instead of himself.
ETA: One thing I want to add, S., because I can see how frustrated you are-- some of this is really developmental. I know it's hard to understand, but at eight he may really be a social kid and just inclined to talking, so he's going to have to gain a lot of self-regulation on this. I loved the idea Mira suggested of having a pat phrase he can whisper to get refocused "Don't get me into trouble-- we aren't supposed to talk now."
I also think Patty W hit the nail on the head with the idea of rewarding his work at regulating himself. Perfect week with no negative feedback from the teacher? Let him choose the family movie to rent, or Saturday night's dinner or some extra time at something he enjoys-- it should be an *earned privilege*.
Some of this may really have to do with his level of maturity, too. There are some areas I wish my son was more advanced in (task persistence, staying focused) however, I know--through his teacher's feedback and guidance-- that this isn't a deliberate attempt NOT to do those things on his part. She has repeatedly reassured this anxious mama (me!) that those abilities come with maturity, which was such a relief to hear. All that to say, hang in there. This is something he's going to have to master on his own-- just keep offering positive encouragement and yes, a privilege to earn if that's what it takes. :) By conveying your disappointment, making expectations clear and offering a goal for him to work toward, you do support the teacher esp. over the long term.