whatever good, (O man !) happens to you, is from Allah; but whatever evil happens to you, is from your (own) soul. and We have sent you as a Messanger to (instruct) mankind. and enough is Allah for a witness. (al-Nisaa': 79)
Allah did not create human beings to be perfect. imperfection is the essence of human existence and it is beautifully illustrated in the Quran through the story of prophet Adam and his wife Hawa. what then is the difference between evil and human being. of course there is large gap of differences between these two. evil transgressed against Allah by refusing to prostrate before Adam and then, instead of mending, and repenting became arrogant and rebelled. Adam and Hawa in the other hand, transgressed too, but they mended and repented. they were forgiven and blessed. thus, Allah wants us to be at our best, but He does not expect us to be perfect. indeed, there is stern warning for those perfectionist who not only does not realise their own imperfections, but actually look down upon others due to their imperfections. this imperfections is no small matter to Allah the greatest indeed, He would not have it any other way.
Prophet Muhammad (peace be upon Him) said, "O people! had you not sinned, Allah would have created a people that would have sinned, and ask for forgiveness from Him so that He would have forgiven them. " (sahih muslim , kitab At-taubah, 6622)
this is not a license to sin, but a categorical affirmation that Allah does want our best effort in the direction of what is right and good, but He definitely does not expect perfection from us. if so, then it is easy to understand why, despite so much emphasis on good and righteous deeds, ultimately our salvation, is not determined by our good deeds alone. if our righteousness and good deeds make us arrogant and induce us to seek fault with others, then we indeed are headed in the wrong direction. good deeds reflects goodness in us. not for the name but for the sake of Allah. indeed, when ikhlas become the subject matter.