This rainbow is the token or sign of the covenant or solemn pledge which I have established between Me and all flesh upon the earth. Genesis 9:17 AmpThe rainbow is a sign of God's covenant with mankind and all the earth. God put the first rainbow in the sky and said whenever He saw it it would be a reminder that He would never again destroy the earth by flood. He said He would never again curse the ground even though man has evil desires in his heart.
God instituted a plan that would change the hearts of people rather than cursing the ground, (like after Adam and Eve's sin) or destroying almost every inhabitant of the earth, (by the flood). The plan was to send His own Son to live a pure and holy life and then offer Himself up as a sacrifice for the sin of mankind.
Now, all who believe in His Son Jesus Christ can receive a changed heart. One that can be filled with God's Holy Spirit Himself, a heart that will desire good and want to live a life that pleases God.
The rainbow can serve to not only remind God of His covenant with us and the earth but also to remind us of the good plan He created instead through His Son Jesus Christ!