Genesis 6:6 tells us that God is heartbroken by our actions
"The Lord was grieved that he had made man on the earth, and his heart was filled with pain"
And so God tried to do a recreation with Noah. But it kept going wrong, humans kept making mistakes and trying to reach God physically (Babel) and become like God. So God brought Moses to be a leader of God's people and gave them the rules of life to live by. But still it kept going wrong and the people kept breaking the law. The trouble was that we longed to be like God, we still do. Just look at our actions and it's obvious how much we desire to be in control of everything in the world.
Wiping out species
Cutting down rain forests
Drilling for oil in the arctic circle
What we find hard to accept is that we are made in the imagery of God but we can not be God.
But although we might break God's heart He forgives us, entirely, completely and Jesus came to Earth to save us from our sins. God's heart was broken but He wouldn't give up, He doesn't give up, He'll never give up on us.