While the story of Jonah is one of the best known in the Bible, nearly everyone misses the real point of the story altogether. The ultimate theme of the Book of Jonah has nothing to do with whales; it is a story of God's merciful compassion for all people, not just the Israelites.
Jonah preached during the reign of King Jeroboam II of Israel (782 753 B.C.). At some point during his ministry, God called him to preach a message of repentance to the people of Nineveh, the capital of the Israelites' bitter enemies the Assyrians, in order that they would turn from their evil ways and not be destroyed. This would be similar to an American preacher being called to bring a message of repentance to Osama bin Laden or the leader of ISIS, knowing that they would turn from their ways and be spared by God. Jonah wanted God to destroy Nineveh (the same way many of us would want al-Qaeda or ISIS destroyed), so he ran in the opposite direction, taking a ship to Tarshish.
This is where the whale comes in. God sent a storm to stop Jonah, and after determining that Jonah was the cause of the storm, the crew threw him overboard. The great fish was simply the means God used to keep Jonah from drowning. After three days Jonah had had enough, and cried out to God to forgive him. The whale then spit Jonah out alive onto dry land, and Jonah began the long journey east to Nineveh. For those who don't believe that the whale (or great fish, we don't know for sure) really swallowed Jonah, take it up with Jesus. He refers to the event as a fact in Matthew 12:38-41 and Luke 11:29-30. If Jesus says it happened, then it's good enough for me.
What happens once Jonah gets to Nineveh is the real lesson of the story. He does as God commanded, calling on the people to repent or be destroyed. To his chagrin, everyone from the king down to the lowliest servants do just that, fasting and praying for God's forgiveness, and God relents from destroying them. Jonah becomes so angry about this that he tells God that he wants to die. God then teaches him, and us, a lesson.
While still hoping that God might change his mind and destroy Nineveh, Jonah goes to the east of the city and sits in the blazing heat. God caused a plant to grow that gave shade to Jonah, and Jonah was very happy. But the next morning, God sent a worm to attack the plant, which immediately withered and died. This made Jonah so angry that he again told God it would be better for him to just die. God simply asks if it is right for him to be angry about the plant, for which Jonah had done no work and which was, after all, only a plant, while having no concern for the people of Nineveh, people just like him whom God had created.
Therefore, the Book of Jonah is not some children's fairy tale about being swallowed by a whale. It is a lesson from God about loving those who are not like us, even our sworn enemies, especially our sworn enemies. Because while he may not condone their deeds, God loves them just as much as he loves us. It wasn't a popular message 2,700 years ago, nor 700 years later when Jesus told us to love our enemies, and it's not particularly popular today. But if we're going to follow God as we should, it is a lesson we must heed.