I believe it was to show His righteousness and holiness; but also as a mirror for us to see our sinfulness. It was a tool to bring us to Christ. Unfortunately, there are still to this day people who think the 10 commandments are intended to help us live a just and moral life. If it would've been possible for them to do that, Christ never would've had to die. They might help someone be a better person in the eyes of the world; however, God's standard isn't "better," but perfection.