I think it's an effective and impressive warning, which makes one think about the tale at length. And the warning is that if you piss someone off by being greedy, you might accidentally get much worse punishment than you actually deserve for a small mischief.
The tale wouldn't make nearly as much of an impression if, let's say, the crabs just roughed the monkey up a little bit and then they all made up and lived happily ever after.
Nor would it be a realistic or helpful lesson, because that is not now reality works: sometimes actions have serious consequences.