Why did God go through all the trouble of coming to earth to save us from our sins? Why did he create statutes that would cause us to sin in the first place? First of all, we have free will, he didn’t make us robots with controls. Left to ourselves, we will sometimes choose sin over righteousness for the sheer pleasure of it. Throughout the Bible, anytime a person was brought before a king, he would have to clean up, and put on the proper garments. They were not allowed to appear before them in their work clothes, or covered in filth.
God is very clear that he should be exalted above all others. He is our King! He cannot look at you if you haven’t clothed yourself in righteousness. The slaughtering of animals offered a blood sacrifice, but would only cover the past sin, and so it had to be done again. Jesus, because he is God, came to give us a sacrifice that was holy, and acceptable, and would cover all of our filth, both past and future. He gave us the ability to appear before God properly clothed. Make a habit of asking for forgiveness, and remember who you are talking to when you pray.
Then Pharaoh sent and called Joseph, and they quickly brought him out of the pit. And when he had shaved himself and changed his clothes, he came in before Pharaoh. Genesis 41:14