in hockey you can get thrown out of the rest of the game for fighting. but people still fight on purpose sometimes.
if you have any way for people to break rules on purpose and get any advantage, they will.
why do they make rules with weak enough penalties that any good can come of rule breaking?
i think a big part of the issue is the fans want to see a good, competitive game. if you penalize a team a ton for breaking a rule, resulting in a very lopsided game and making the ending result no longer in doubt for the rest of the game, then the fans won't like that. it'll be boring to watch.
so there's this tension. on the one hand, they want to stop people from doing certain things. but on the other hand, no matter what anyone does, they don't really want to mess up the game. they want to play on and have it still be exciting, not have one team (or individual player) too handicapped to compete.
plus, the bigger the penalties are, the harder it gets to call a penalty. the more effect calling penalties has, the more referees will have to let small stuff slide. so then players figure out where the line is. and now you have players trying to get as close to the major penalty line as they can without crossing it, and if they slip up just slightly then they get a BIG penalty for doing something slightly on the wrong side of the line. tiny change in behavior, big change in consequences. that's a really bad system. and much worse given the human error factor – people are trying to play just up to the limit of what the ref won't call a penalty on, but have to account for the ref's judgments on each play being randomly wrong by a significant factor in either direction. so it's not just pure skill to go near the line without crossing, it's also luck. you have to figure out the normal range for ref judgements (like judges stuff between 20% more or less severe than it actually is) and then account for that, but then you can be screwed by a random outlier judgment. (i'm thinking the ref judgments are basically what you actually did, modified by a random factor that's on a bell curve).
oh and to make matters worse, most people don't draw a clear line between violating the spirit of the game (good sportsmanship) and the explicit written rules of the game. so there's fan pressure to judge things like intentions of actions, and whether coming near violating a rule repeatedly without actually violating it is bad sportsmanship that should be punished, and so on.
most people see all kinds of misbehavior as on a continuum and don't actually care all that much about the written rules. refs and court judges are supposed to be better than that and go by the actual rules, and do so with very variable success. (even the supreme court is pretty crap at it, especially the lefties)
this kinda stuff affects all types of games, including board games and video games. it varies though, e.g. if there's no fans watching to worry about.
some of it's also an issue for social news sites. for example, reddit tries to have rules to limit ways of getting upvotes. people who do everything they can to get upvotes just shy over breaking the rules will be most effective at getting upvotes.