These things happened to them as examples for us.
In 1 Corinthians 10, Paul speaks about the Israelites who followed Moses and the consequences of their actions that displeased God. They all started with the same spiritual food and drink, but somewhere along the way they started doing their own thing, which caused calamity to come upon them. After describing their fate, Paul reminds us that what happened to them were examples written down as warnings for us, and the modern language tells us to check ourselves if we think we are standing. In other words, if any of us feels that we would never do any of the things that the Israelites were involved in, think again...
They were written down to warn us who live at the end of the age.
If you think you are standing strong, be careful not to fall. The temptations in your life are no different from what others experience. And God is faithful. He will not allow the temptation to be more than you can stand. When you are tempted, he will show you a way out so that you can endure.
~1 Cor 10:11-13 (NLT)
There is nothing that one individual has gone through at one time that hasn't happened to another. Only God knows why people make the bad decisions that they make, even when a way of the situation is always available. It's not our job to figure that out for anyone, but it is ours to learn from their mistakes. It's not our place to censor or judge them, it's our place to humble ourselves and remember that the same thing can happen to us. No rational thinking person wakes up one morning and decides to do something that will destroy their family, ruin their reputation, and bring their ministry down. There is always a path to destruction that starts at a blind spot. What's yours?
Avoid the temptation to speculate, tear down or have a "holier-than-thou" attitude when you hear about someone who has sinned. The enemy is always looking for opportunities to knock us down from our high place. He's looking for you, too. He's watching to see what he can use, who he can send your way to take you out and shame you. He hates the worship of God; He hates God and all people; He hates when people worship God. His goal is to steal, kill and destroy completely, including those who lead others to worship God. Don't help the enemy!