The moral of the story is, "Don't be greedy." The wicked troll could have beaten the smallest or the middle-sized billy goat, but he chose to wait for the biggest billy goat. This proved to be his downfall.
According to Humanites 360, other important themes are apparent in this story. The good billy goats defeat the evil troll, and good versus evil is a common theme in fairy tales. The billy goats show great courage by taking on the troll instead of running away from the bridge. Even though they are afraid, the bill goats think of a clever way to win against the troll by appealing to the troll's greed.