Now all these things happened to them as examples, and they were written for our admonition, upon whom the ends of the ages have come.
1 Corinthians 10:11 (NKJV)
Some Christians are so confident in their faith and knowledge of God that they feel comfortable in their lifestyle which leads them to become an idol to themselves. Supposedly spiritual, they exalt themselves above others, especially those who are weak in faith. They think they have the answers to everything and they believe they are spiritually mature enough to need to pray and study the word with others. Arriving at this stage, they do not see the dangers that await them.
This attitude is no different from that of the Israelites in the desert. Knowing that they were God's chosen people and had His protection, instead of humbling themselves and obeying His word, they abused this privilege to live as they wanted and demand what they wanted. . To them, having the protection of the living God made them a special people and more important than the nations around them. This is what caused them to fall into idolatry.
Falling into immorality and debauchery, they lost the affection and blessing of God. For this they were punished. With this verse, Paul wants to remind us that the history of the Israelites must serve as an example for us not to let ourselves be carried away by our pride and our spiritual freedom, believing that we can live as we want in the name of grace and forgiveness of God. While it is true that the blood of Christ cleanses us from all our sins, it in no way saves us from the consequences of our sins.