You asked a very good question. One that requires thinking outside the box and questioning the general acceptance. The actual answer to your question is - **We do not know**. We are living within the realms of our universe. God is not bound to time and existence as we are. So we are only capable of thinking so much. We do not know why God created us is the real answer. Most people try and give their own reasons but most of them contradict God's characteristics. God has no needs, wants, desires, requirements so if he is perfect then why create? In Islam, everything is pre-destined by God: > “No calamity befalls on the earth or in yourselves but it is inscribed in the Book of Decrees (Al‑Lawh Al‑Mahfooz) before We bring it into existence. Verily, that is easy for Allaah - [al-Hadeed 57:22] This indicates that whatever will occur in humanity has already been decided and written before we came into existence. Your question about why God created bad people is a question which nobody can justifiably answer without trying to divert the question onto other related aspects of creation. Let me give you an example. God knew that there will be this little boy who will grow up, take charge of Germany and kill millions and millions of Jews. God knew this will happen before he decided to create. Therefore God is the creator of both good and evil. So by that we can conclude that God is the ultimate creator of everything. So then the question arises, **WHY?**. Why did this perfect God who does not desire, require, want, need anything decide to create? Some people would argue life is a test for heaven and hell. But how can it be a test if God is the one who has decided the outcome of eternity? What is he testing? It cannot be human choice because ultimately we are not given one. Can he be testing his own powers? That would indicate imperfection. Anyone who argues God needs, wants, requires or desires anything then that would immediately contradict God's attributes and would indicate imperfection. Those are human characteristics, which is why were imperfect. **Shi'a belief:** > God has not set a definite course for human history. Instead, God may alter the course of human history as is seen to be fit. Shiite states that matters relating to the human destiny is of two kinds: definite and indefinite. To explain the definitive one, Shiite argues that God has definite power over the whole of existence, however, whenever He wills, He can replace a given destiny with another one; and that is what is called indefinite destiny. - (*[Wikipedia][1]*). Overall, we can argue many reasons as to why God made us in the first place, regardless of whether they were good or bad. But we definitely cannot put our fingers on this one. We simply don't know enough. Sometimes saying we don't know something is better than fighting a lost battle. Oh and by the way.. that little boy's name was Hitler. [1]: https://en.wikipedia.org/wiki/Predestination_in_Islam#cite_note-17