In this text, we see Satan laying the charge of Joshua the high priest being unfit for his position. The filthy garments that he wore were representative of sin. Joshua was not qualified to be in a priestly office for that reason. It follows that he could not offer up sacrifices for the people. Thus, no forgiveness of sins could be obtained for the Jews.
The filthy garments had to be removed from Joshua. God gave to him a set of pure garments so that he could fulfill his position as high priest. This turban had an inscription which read as: "Holy to the Lord" (Exodus 28:36-38). God carried out the work of bestowing new garments on Joshua Himself. He saved the Israelites from complete destruction. God clothed them in His own righteousness.
The act of God providing a new garment for His people gives us a picture of Him putting away our sin and giving to us a foreign righteousness which is His. This incident shows us how God justifies sinners. Instead of giving to us the eternal punishment that we deserve because of our sins committed against Him, God out of His love for us has chosen to exercise mercy. Jesus Christ cloths us in His righteousness in order that we be reconciled to a holy God and render service that is acceptable to Him.