If you have confused yourself, or allowed someone to confuse you, with the idea that it is only God that determines whether, or not one is saved, then I do not think that you can understand that sin does, indeed, have a purpose.
Sin is both a noun and a verb. Sin is the opposite of righteousness. If righteousness is one choice and we can choose not to do righteous acts, then the other choice would have to be the opposite and it is called sin.
If you believe that it is only God that chooses those who will be saved, then even Jesus had/has no purpose. Why would anyone have to suffer the punishment for sin, if God were going to choose the saved, without considering sin? And if God did consider sin, then, because all humans sin, no one could be saved. So, then sin would have no purpose and all the wrong done in this world was for nothing!
(Isa 59:1&2 NIV) “Surely the arm of the LORD is not too short to save, nor his ear too dull to hear. But your iniquities have separated you from your God; your sins have hidden his face from you, so that he will not hear.” You can see that sin is what separates us from God and we all sin. The Gospel, or good news is that all, who want to be saved, can be saved, through Jesus Christ.
Mat 7:78 “Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. For everyone who asks receives; he who seeks finds; and to him who knocks, the door will be opened.” That is good news to all sinners and it could not be true, if salvation was only for those that God would choose.
If it is only God that chooses then what purpose is the Bible? It would only confuse both the lost and the saved. Who would need to know anything about God, if it were only God that chose and man could neither help, nor hinder Him with His choice!
I, for one, cannot see any purpose in “anything”, without free will. I know, for a fact that I am free to sin, because I have, and though I do not want too, I still sin. I believe that God lets me sin, so that I do not forget my need of a Savior. It is not enough for me to remember Jesus only during communion.
So, you are probably thinking ‘Well, when are you going to tell me what is the purpose of sin?’ Right now. Sin is proof we have free will. If there were no free will, there would be no sin. Sin is to disobey God and everyone disobeys God.
The purpose of sin is, SIN PROVES GOD CORRECT, because the result of sin always hurts others as well as the sinner and if we do not sin then no one is hurt. It proves God’s way is right.
Another purpose of sin is SIN SEPERATES THOSE FROM GOD WHO DO NOT WANT TO BE WITH HIM. It also separates those who will not do to others, as they would have others do to them, from the saved. We will be at peace in Heaven, because everyone will do to others as they want others to do to them and there will no longer be any sin. There would be no longer any purpose in it.