In some of my previous posts, I've talked about freedom of choice. To summarize: God has given us all free will. In everything we do, we are free to choose between good and evil. Satan may tempt us in many ways, but we always have a choice. Free will implies accountability to God for our actions. However, no one is perfect and we all make bad choices at times.
This presents a real problem for every human being. We are accountable to God for our bad choices, yet we all make bad choices. So what standard does God use when judging our actions? Unfortunately for us, the bar is set very high. We are all aware of the Ten Commandments: do not kill, do not commit adultery, do not bear false witness, etc. We might look at ourselves and say "I never killed anyone, I never cheated on my spouse; I'm doing pretty well". Actually, the bar is set much higher, because it's not about the letter of the law, it's about the spirit of the law. In Matthew Chapter 5, Jesus says "You have heard that it was said to the people long ago, 'Do not murder, and anyone who murders will be subject to judgment.' But I tell you that anyone who is angry with his brother will be subject to judgment. You have heard that it was said, 'Do not commit adultery.' But I tell you that anyone who looks at a woman lustfully has already committed adultery with her in his heart."
That's a tough standard to be judged by: not just the letter of the law, but the spirit of the law as well. Not only is murder unacceptable, but so is anger. Not only is adultery unacceptable, but so are lustful thoughts. You're probably thinking "no one could measure up to that standard". You're absolutely right. As Paul states in Romans 3:23 "all have sinned and fall short of the glory of God". In a nutshell: God's standard is perfection and we are not perfect. Therefore, we would all be subject to God's wrath except for this: "For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." (John 3:16)
God knew from the creation of the world that giving us free will could result in sin, and therefore Jesus (who "was with God in the beginning" and "through him all things were made", John 1) was part of God's plan for salvation from the beginning. In the Old Testament, the Israelites would sacrifice animals to atone for sins, but this was only a temporary solution - the ultimate atonement was made by the Lord on the cross. "But he was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed." (Isaiah 53:5) Because God loves us all, he allowed his only son (the perfect lamb) to suffer the punishment that we all deserve, so that all might have an opportunity for salvation. What is required to take advantage of this opportunity? Believing and confessing that Jesus is the son of God, repenting of our sins, baptism in water, and (this is the hardest part) making an honest effort to follow the teachings of Jesus and the example he set (see Matthew 28:18-20). This is God's plan for salvation, offered freely to everyone who is willing to accept it.
Knowing all this, you may be thinking: why did God give us free will if he knew we might choose evil? Why would he allow his son to come into this world and suffer so much for the sins of others? I don't pretend to understand God's reasons fully, but the Bible does offer some insight. In Matthew 5:43-48, Jesus tells us to follow God's example and love not only our friends but also our enemies, because God loves both the righteous and the unrighteous and gives freely to both. Which is harder, loving your friends or loving your enemies? Which demonstrates greater love, love for the righteous only or love for both the righteous and unrighteous? God gave us free will, knowing our potential for evil and realizing that our actions might have terrible consequences; yet rather than punish us as we deserve, loves us in spite of our flaws and allows his only son to bear our sins on the cross. Above all else, God wants us to love one another, so this is his way of teaching by example, showing perfect love to us despite our imperfections. Would any of us allow one of our children to be crucified if it would save someone else? I doubt it, especially if that person was guilty of horrible crimes. "But God demonstrates his own love for us in this: While we were still sinners, Christ died for us." (Romans 5:8) When you see all the evil in the world, it's natural to wonder why God gave us free will, but when that evil is viewed against the backdrop of the cross, the limitless depth of God's love is clearly apparent.