God has given us the ability to choose. We were made in God's image, and he has given us the freedom to decide how we will act and the ability to make moral choices. This is one asset that sets us apart from animals, but it also is the source of so much pain in our world. People, and that includes all of us, often make selfish, self-centered, and evil choices. Whenever that happens, people get hurt.
Sin is ultimately selfishness.
Unfortunately, sin always hurts everyone, not just ourselves. God could have eliminated all evil from our world by simply removing our ability to choose it. He could have made us puppets, or marionettes on strings that he pulls. By taking away our ability to choose it, evil would vanish. But God doesn't want us to be puppets.