The Qur’an states that He (God) created the human (Adam) with “His two Hands.” This verse has two meanings. The popular interpretation is that God took extra care (two hands) in creating humans. The deeper meaning is that since God has no hands, God created humanity (Adam) with “His (humanity’s) two Hands” meaning humans have two hands because humans are responsible for overseeing (as ‘Khalifah'-vicegerents) God’s world.” (38:75).
The most notable distinction of all humans is their ability to behave in a morally upright way. God says, “Do you reject belief in the One who has created you from dust, then from a clot, (and) then made you (through divine revelations) an upright (moral) mankind?” (18:37; also 82:7, 32:9, 38:72).
The Qur'an states (2:30) that when your Lord (the one God) said to the angels (malak in Arabic means 'message'; and in Hebrew malakh means agent, deputy or emissary) : “Lo! I am about to place a vicegerent on earth,” they said: “Will You place on it one who will spread mischief and shed blood while we celebrate Your glory and extol Your holiness?” He (God) said: “Surely I know what you do not know.” This same discussion can be found in the Jewish Oral Torah.
The angels did not considered themselves suitable for ‘vicegerency' because they lacked free will. What God wanted was to create creatures who would always choose to be kind, peaceful, honest, moral and loving even without rewards.
Many people frequently say why did not God create only good hearted, kind and non-violent humans. And the answer is to test humans as individuals; and as religious communities and political governments.
'Khalifah' or vicegerent is one who exercises an authority delegated to him by his principal as his deputy and agent. All the authority he possesses is derived from, and circumscribed by, the limits set by his principal (God). The term Khalifa is mentioned 9 times in Quran in 9 different verses. The above verse (2:30) is the first time Khalifah is used.
The second time is (6:165) "And it is He who has made you (humans) successors upon the earth and has raised some of you above others in degrees [of rank, power, status, talent, leadership] that He may try you through what He has given you. Indeed, your Lord is swift in penalty; but indeed, He is Forgiving and Merciful."
God has made you (humans) successors (rulers) upon the earth and has raised some of you above others in degrees [of rank, power or leadership] that He may try you through what He has given you”. We all know that power tends to corrupt; and that total power totally corrupts.
This is why the ninth and last of the Qur'an verses tell us (38:26) about the great Messenger / King Prophet David: “David, We have made you a 'Khalifah' vicegerent successor upon the earth, so judge between the people in truth and do not follow [your own] desire, as it will lead you astray from the way of Allah.” As a Zabur/Psalms Messenger Prophet King David was a pure Poet. As a Judge he was always fair, but as a husband and father he was often corrupted.
God wisely chose Prophet Abraham’s two sons who had trusted in the One God, and inspired Prophets Ishmael and Issac saying to them (7:69) "Then do you wonder that there came to you a reminder from your Lord through a man from among you (descendants) Prophets Moses and Muhammad, that he may warn you? And remember when He made you successors after the people of Noah (the Banu Israel) and increased you in stature extensively. So remember the favors of Allah that you might succeed.”
And to the descendants of Ismael (7:74) "And remember when He made you successors after the ‘Aad, and settled you in the land, [and] you take for yourselves palaces from its plains and carve from the mountains, homes. Then remember the favors of Allah and do not commit abuse on the earth, spreading corruption.
God continues to demand monotheism (10:14) "Then We made you successors in the land after them so that We may observe how you will do."
And as a world wide example (10:73) they (idol worshippers) denied him (God and Noah), so We saved him and those with him in the ship, and made them successors, and We drowned those who denied Our signs. Then see how was the end of those who were warned.”
For (27:62) "Is He [not best] who responds to the desperate one when he calls upon Him and removes evil and makes you inheritors of the earth? Is there a deity with (along) Allah ? Little do you remember."
To this day (35:39) "It is He who has made you (Humans) successors upon the earth. And whoever disbelieves – upon him will be [the consequence of] his disbelief.” Indeed, those who go astray from the way of God will have a severe punishment for having forgotten the Day of Account.
Thus, the answer to the question why did not God create only good hearted, kind and non-violent humans is found in the first verse to mention Khalifah: “And [mention, O Muhammad], when your Lord said to the angels, “Indeed, I will make upon the earth a successive authority.” They said, “Will You place upon it one (species) who causes corruption therein and sheds blood, while we declare Your praise and sanctify You?” Allah said, “Indeed, I know that which you do not know.”
The Qur’an Demands Self-Discipline for individuals; and Moral Self-Government for religious and ethnic-political communities.