The punishment involves grossly and vaguely humiliatingly washing his mouth out with soap and Harry has to do two spells plus gargle mouthwash before the taste is completely gone. As punishment goes it’s memorable without being awful, made better by Marvolo staying with him, playing with his hair, as he falls asleep.