God allows struggle and difficult times because we are sinners and we all come short of the glory of God. He knows that by allowing us to experience failure, pain, and struggle, we will grow stronger in our faith and to become closer to Him and moving away from sin. God does not cause suffering, but He can and may allow it to accomplish good.