By nature God created us to be in fellowship with him right from the beginning. We see how God communed with Adam and Eve in the garden and walked and talked with them in the cool of the evening. God has placed such an importance on us knowing him that he innately set this knowledge in our hearts.
God chose us and desires for us to choose Him. He does not force this relationship and when we chose not to recognize him as God or be in relationship with Him, He allows us to walk in the will and direction we chose for life. He does this so we, by free will alone will come to Him.
Previously in this chapter, Paul stresses that we have intuitive knowledge of God. Romans 1:19 tells us that, what can be identified about God is clearly seen. He made this knowledge of Himself known from the very beginning. This knowledge, along with directing us into relationship with Him, will also prevent us from doing such depraved sinful acts. Because the knowledge of God will counter those desires if we choose to recognize His will before our own desires.
Since God has given us free will to choose Him and free will to be without Him, Paul tells us in verse 24, that when we do not choose Him, "God gave them over to the sinful desires of their hearts..." Clearly God will not force His restraint on us against our will. If we desire and seek out the sinful desires of our heart, then God will give us over to those desires.
In following the desires and lusts of our hearts we actually turn ourselves over to the degrading power of sin. What starts out small can snowball into the degradation of our bodies in shameful ways. Over time, this condition produces hardness of heart and a reprobate mind.
All of this can be avoided by recognizing God. Today choose His will above your own. Come into relationship with Him through His son Jesus' redemptive power. Experience true joy and godly contentment through relationship with Him. Today may you recognize that Him as everything needed for this life.