Why you shouldn't punish a baby
Babies--0 to 1 year--do not have a sense of right and wrong, or or "allowed" or "not allowed," and will not develop one until late toddler or even preschool-age. As I personally define punishment as a means to penalize or serve retribution for something done wrong, I do not think that babies should ever be punished. Yes, ever.
Younger babies cry to communicate, and although they can be difficult to soothe, their motives are entirely internal and need-based; they simply do not have the capacity to want more than basic things like love, food, sleep, and diaper changes. This communicative crying, although it can be frustrating if you cannot soothe baby, should never be considered as "misbehaving."
Once baby becomes older and more mobile, he or she will get into things that you have not properly protected or removed from reach. Saying "no" may help, but most likely, it won't, because while some babies understand "no" at 6 months, most don't until between 12 or 18 months. And again, baby is doing what he or she is naturally programmed to do--exploring and learning. It will be far more effective to remove temptation and use distraction than expect a baby to learn what is "right" and "wrong."
Babies don't do "wrong"--they don't have the cognitive development to acknowledge rules, let alone break them, so while you may enforce safety rules and create safe environments, it is my opinion that it is never appropriate to punish a baby.