Good question. He created everything for His purpose, humans being the pinnacle of His creation. Mankind was supposed to look after God's creation, but we have been very poor stewards and failed miserably.
We may never fully understand God or His purposes in this life, but we know that He has one, "And we know that all things work together for good to them that love God, to them who are the called according to his purpose." (Romans 8:28)