It helps to remember that fights in hockey are 99% consensual. If you don’t want to fight you turn your back and that’s it. There are players that fight and players that don’t, and it’s not really a machismo/honor thing that you MUST fight. No one thinks less of you for not being a fighter.
If you jump someone who is NOT looking for a fight you are usually going to get tossed from the game and probably suspended for a few games to boot. It’s not OK to blind-side someone who is not likewise spoiling for a fight and generally speaking that is frowned upon.
So the minor penalties and general lack of punishment is only in the case of two people who have collaboratively decided to go at it, which is true for almost every fight you see. They are pre-arranged (often at the face-off) and mutually agreed. At that point, two consenting adults doing what they want, basically, and the refs leave it alone until someone is at risk of getting seriously hurt — usually once someone goes down and it’s no longer a standing fight, or if other people are getting involved, or if one person is effectively incapacitated, etc.
To some degree hockey is a self-regulated game. Refs are there for line calls, not necessarily behavior control. 10 people flying around a small ice surface at 40km/h with wooden sticks can REALLY hurt each other while the ref is looking the other way if they want to.
To avoid this, fighting is used as a pressure relief… all the pent up aggression you feel for the wrongs and slights done to your team goes into cheering for your guy in the fight. Afterward everyone chills out. This is generally true even if the two guys fighting aren’t the actual guys you were mad at. But the thing is, everyone on your team is going to be mad at someone different for some random thing that happened, so it’s not practical to expect everyone will “pay” individually.
This mostly works because most players aren’t assholes. If they do something to earn your ire it was probably by accident or a “one time” thing. It’s unlikely you’ll remember it for more than 5 minutes and unlikely that guy is going to specifically tick you off again. So the fight serves to release the cumulative pressure of all those little things, not necessarily any specific incident.
Where this fails is if there is just that one total dick on a team that is constantly cheap-shotting people or otherwise behaving in a douchey way not consistent with the overall tone of the game. Especially if that person keeps doing it even after a fight or two. At some point the other team is going to remember his number and a “generic fight” won’t fix the issue. That guy now has a target painted on his back and at some point — maybe not even that game but in a future game — someone is going to risk getting tossed from the game/suspended to teach that specific player a lesson.
Though usually half of that guy’s own team are just as happy to watch him get creamed because, honestly, he IS a dick. We’d never say it out loud of course, team solidarity, rah rah rah… but at some point people get what they deserve and everyone on both sides knows it.