God, in His perfect wisdom, created a universe where both salvation (election) and damnation (reprobation) would occur, and He did so with full knowledge and purpose. The "why" is considered beyond human comprehension but is trusted to be just and good from God.
For every thing a season and a place under Heaven. Though He knew us at the beginning before we were formed, He has given a time for us to live by faith. The Jews were shown signs and given the Law but fell so the Gentiles might be grafted in under Grace. This too was with the foreknowledge that once the full number has been brought in, they of the original vine may be grafted back in and take to it all the more readily. Those who have been forgiven of much love much while those who have been forgiven of little love little. This has been so that in the end, they may love greatly.
Though He knew us in the beginning, we are to be as adopted children rather than as slaves lest we live in fear. Fear is given its time to bestow obedience as humility is to fear God. Once one becomes obedient however, they need no longer fear but love. Sin exists so that mercy may be received but it's purpose is limited as we do not remain unruly forever. Every knee will bow but now we are granted opportunity to do so by our own choice with faith.
Some argue His foreknowledge eliminates free will and that we are just puppets. God is higher than us. Nothing is difficult for Him. If He writes a book, He can bring the characters out of it and make them real. Though we have our stories meticulously crafted, we are allowed to experience them and live this life to develop into the characters He wishes to make us into. In Psalms, it says you are gods, adopted children of the Most High, but you shall die like mortal men. Later on in the New Testament, we are told that Jesus died so too must those who follow him, sharing in death so that they may share in the resurrection. Death frees us of our sinful nature in this flesh but we are promised new flesh and in Revelation, a white stone with a new name no one knows.
The path of mercy has been prepared for us. The law is written in every man's heart with the Holy Spirit manifesting as our conscience. Even so, rather than slaves without choice, we are given opportunity to accept the mercy and love God by our own volition so that it may be genuine by our own heart. For such a choice to be possible, so too must the opportunity be to reject it no matter how bad it may be. That is why damnnation must exist. God does not wish to condemn but to give mercy.