salam bro
i dunno whether my is right.
but here is my ans.
There are two answers to this question.
Firstly, we will never know the real reason behind it. Why create this world in the first place? These are things which God has decreed and we can't imagine a world that is otherwise, nor can we ever understand why God did so.
And, secondly, everything in this world submits to the will of God. The stars and the planets swim in their courses, predetermined by God, never deviating. The same goes for anything else, including our bodies. God has given human-kind and jinn-kind the gift of true free will (higher developed animals also have free will, but nothing approaching the human level). Because we have free will, we are held accountable for our actions. The laws of nature, are the laws of God, and everything follows them anyways. Everything, from the sun, to the planets, to the stars, to the rocks, are all Muslim. They submit to the will of God... because they have no choice. We, on the other hand, as far as our minds go, do have a choice in the matter. Free will is a double-edged sword. This is why Allah says in the Qur'an that the best believers are the best of creation and the worst amongst the disbelievers are the worst of creation (the exact verses go [translated]: Indeed, we have created man in the best of forms. Then he returned to the lowest of the low, except those that have faith and do good; ...). Islam is the religion from God to make our free will Muslim as well, so it can exist in harmony and peace with human nature, with other people, and with the other creations of God. We can do anything we will, as long as it stays within the guidelines of Islam. As long as it stays within the guidelines of Islam, it is guaranteed to only be used for good. And, indeed, the power of the human mind is enormous. It is what makes us special: animals have claws, teeth, etc to defend and take care of themselves... we have only our mind! Such a powerful mind is capable of enormous evil and enormous good. When moulded and shaped by Islamic principles, the mind is capable of great good.
FI AMANILLAH