In the beginning...
God made the world and its inhabitants perfect, good and without sin. He made us to be His friends and He made the planet for us to live in, enjoy and look after.
The basis for this friendship is love. Therefore, He made us with the faculties to love (which enable us to express and receive love) and gave us the gift of freedom with which we could choose to accept or reject His friendship, or do right or wrong.
However, all of us have exploited God’s gift of freedom, cared nothing for His love, rejected His friendship, walked out on Him, ignored His rules for safe and happy living and instead done as we pleased.