Psalm 106 reads like the history of a teenager. The girls I taught for Confirmation class decided that the Israelites sounded a lot like spoiled teenagers. They do something wrong, they get grounded, they're very sorry, and then they do it again. Over and over and over again.
Psa 106:7-13 Our fathers, when they were in Egypt, did not consider thy wonderful works; they did not remember the abundance of thy steadfast love, but rebelled against the Most High at the Red Sea. Yet he saved them for his name's sake, that he might make known his mighty power. He rebuked the Red Sea, and it became dry; and he led them through the deep as through a desert. So he saved them from the hand of the foe, and delivered them from the power of the enemy. And the waters covered their adversaries; not one of them was left. Then they believed his words; they sang his praise. But they soon forgot his works; they did not wait for his counsel.
God has just saved His people from slavery here, and it does not take long before they start doubting him. Can you imagine, so soon after seeing all the first born of Egypt slaughtered for you, doubting the hand that did it? I can. We do it all the time now when we doubt God and don't trust in Him, even though He had His own son slaughtered for us.
Psa 106:19-22 They made a calf in Horeb and worshiped a molten image. They exchanged the glory of God for the image of an ox that eats grass. They forgot God, their Savior, who had done great things in Egypt, wondrous works in the land of Ham, and terrible things by the Red Sea.
God has now rescued them and established a covenant with them. Which they rapidly break.
Psa 106:24-27 Then they despised the pleasant land, having no faith in his promise. They murmured in their tents, and did not obey the voice of the LORD. Therefore he raised his hand and swore to them that he would make them fall in the wilderness, and would disperse their descendants among the nations, scattering them over the lands.
He commanded them to go and take the Promised Land. They freaked out and were too afraid to proceed, doubting that God would sustain them. Remember, this is after he saved them from Egypt and at the Red Sea. This is what prompted God to decide none of that generation would enter the Promised Land, save Joshua and Caleb.
Psa 106:34-36 They did not destroy the peoples, as the LORD commanded them, but they mingled with the nations and learned to do as they did. They served their idols, which became a snare to them. They sacrificed their sons and their daughters to the demons; they poured out innocent blood, the blood of their sons and daughters, whom they sacrificed to the idols of Canaan; and the land was polluted with blood.
God had commanded them, once they entered the Promise Land, to destroy all the people they found there. This sounds harsh, but He was trying to keep Israel pure to serve Him. This would allow them to spread the news of God afar without tainting it with corruption. Since they did not obey, they fell prey to the idols of the other people, just as He had predicted. They went so far as to offer up their own children as sacrifices. (sound familiar to anything we're doing here?).
Psa 106:43 Many times he delivered them, but they were rebellious in their purposes, and were brought low through their iniquity. Nevertheless he regarded their distress, when he heard their cry. He remembered for their sake his covenant, and relented according to the abundance of his steadfast love.
Even though Israel played the harlot (unfaithful to their promise), God still saved them as a people after punishing them. Just like a parent who grounds, forgives, and grounds again, God always took His people back out of love and faithfulness. A more familiar example of this concept is found in the Prodigal Son story in Luke. This is what He does for us when we repent and return to Him. He will take us back!