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.
Sadly, all of us have and are (to some degree) exploiting God's gift of freedom by: denying His existence, caring little for His love, rejecting His friendship, ignoring His rules for safe and happy living and instead, doing as we please.