Why did God do this? Because Jonah ran away from Him and what God told him to do. He didn't care about the people of Ninevah. He'd rather them die in their sin and experience God's wrath than tell them to repent.
And by running from God, by refusing to do what God told him to do, he put the sailors in danger, in fatal danger (the sailors on the boat he was fleeing on).
We can do the same thing. Most of the time for us it isn't fatal physical danger we put others in when we don't obey God, but we might easily be putting others in spiritual and emotional danger when we follow our ways rather than God's.
Are you willing to pay that price to live your own way?
As parents, as adults who very likely has some children watching their lives, we need to realize what is at stake when we don't follow God.
If you are a parent, every decision you make affects your children. From you they learn how to follow God. From you they learn what is important. From you they learn how to live. And if you are choosing the Self Way, they too will begin to copy that.
If you are following God even when it is really hard, they take notice. They might not say anything, but they notice everything you do.