Which is more less how society should treat humans as well.
If we're going to have an article called "Why Punish?" there should really be a companion article on "Why Steal?" And given the right conditions literally every one of us will steal to survive. Every single one of us are still just animals at our core anyway, that means you dear reader.
I attack my opponent when he's waking up (Oki position), he uses a Dragon Punch / Reversal and punishes me.
I attack my opponent when he's waking up (Oki position), he uses a Dragon Punch / reversal and punishes me.
I attack my opponent when he's waking up. He uses a dragon punch/reversal and punishes me.
I block while my opponent is waking up. He uses a dragon punch, loses to my block and I punish him.
------------
An entire genre of video games, fighting games, revolves around conditioning your opponent and getting into their head. The rock-paper-scissors battle of attack vs block vs grab takes place so quickly, you often don't have the time to react (though some players do have insane reaction speeds).
When you can't leverage reaction, you leverage conditioning. And over the long term, the only way to really learn the game at a high level is by getting your bad habits repeatedly-punished by a stronger player.
Perhaps its not "efficient" to learn, but in this case, it is the only way to learn. Expert players are bad at vocalizing what is or isn't working. There are very few coaches, and almost none of them know how to take you to the highest level (even if they themselves have reached peak form).
-------------
There's other forms of punishment as learning. Ex: fall into a pit in Mario. You die, so you try again.
Or "Boar Lure" in AoE2. If you fail, your villager dies, and/or you don't get the precious early-game food you need to sustain your production.
Or in Basketball. If you get crossed up, you fail to block the opponent and they get a free shot at the basket.
Use of punishment in dog training is actually pretty hotly debated. Not that it doesn't work, but that it has consequences beyond what are intended and that substitution, redirection, and rewards result in a happier and more obedient pet.