The legal system, its representatives, and principles rarely appear in traditional folktales despite the importance it has in daily life (don't jaywalk kids!). However, a few exceptions stand out.
“Tainted Witness” in Burmese Law Tales by Muang Htin Aung.
“The Fly” in Best-Loved Folktales of the World by Joanna Cole.
“The Peasant and the Workman” in Folk Tales of All Nations by F.H. Lee.
“Nature’s Way” in 100 Armenian Tales and Their Folkloristic Relevance by Susie Hoogasian-Villa.
“The Five Queer Brothers” in Chinese Nights' Entertainment by Adele Marion Fielde.
Orestes at Athens by Aeschylus, translated by Oliver Taplin
Judgement of Solomon in the Bible (1 Kings 3:16–28)
There's also a criminological study a German fairy tale corpus:
The Criminological Significance of the Grimms’ Fairy Tales (1987) by Gerhard O. W. Mueller.