But why punish them ? I assume someone’s who brings coffee in to class is not a kid anymore and their punishment is missing out on education.

As long as the teacher doesn’t retell the stuff he/she missed it shouldn’t matter to other students I guess