How do the Ten Commandments relate to social justice?
This is a great question. If you look at the Ten Commandments, then you will realize that they first deal with people's relationship with God (first four) and then with each other (final six). From a theological perspective, what the Ten Commands are saying is that the basis for morality is first rooted in a knowledge of who God is and what he has done. So, for the Jew and the Christian and the Muslims, the Commandments are the foundation for all morality.
With this foundation, an application of the Ten Commandments leads to social justice. For example, the Ten Commandments prohibit murder, adultery, stealing, bearing false witness, and coveting. We can synthesize these commands to the injunction of creating a better world, where social justice reigns. This is one of the main points of the Old Testament or Hebrew Bible (Torah). God desires obedience, not so much sacrifice. We might ask obedience to what? The answer would be to the Ten Commandments. When this obedience exists on a theological level, there will be social justice.
One example should suffice. If people took the idea of no stealing seriously, all people would be paid a fair wage. There might even be debt forgiveness. After all some loan are outrageous and the concept of Jubilee comes from the Old Testament/Hebrew Bible (Torah).