I agree with chocaholic, I don't think kids should ever be punished for toileting accidents, even if they're not so accidental.

I would be getting him to clean his own messes up though (with in his capabilities and with supervision). Give him as little attention as you can in regards to an accident, as then there is little pay-off for him (eg, if he wets/soils himself and you clean him, you're having a rather intimate and long interaction). So get him to wipe up his own puddles, wipe his own bottom, get his clothes and dress himself.