As with all of the fables that are attributed to Aesop, the story of the bear and the bees (or the bee hives) is meant to teach a moral lesson. In this case, the lesson is that a person's reaction to small annoyances can hurt them more than the annoyance itself.
In most versions of this story, a bear is stung by a single bee. He then reacts by trying to destroy the whole hive of bees because he is angry at being stung. When he does this, of course all the bees come after him and he is in much more danger than he had been before. This story is meant to convey the message that a person who reacts in anger to small things is liable to hurt themselves more than the small things ever could have hurt them.
So the theme here is that it's important to keep your temper.