It tends to be omitted from people's pattern of the regular reading of Scripture - for example, it doesn't feature at all in the RCL. It is entirely surrounded by the Joseph story, yet it's almost always omitted from that too. But it isn't just a random bit of story from somewhere else that got caught here.
A few quick thoughts about Genesis 38...
See, the Joseph story ends in Genesis 50 with two sons being blessed - Joseph and Judah. It's actually the story of both of them - Joseph goes on to be the father of the largest number of Israel, and Judah becomes the ancestor of its kings. Judah's last action before Gen 38 was in chapter 37, where he suggests selling Joseph into slavery rather than killing him. That wasn't motivated by compassion for Joseph at all - it was rather because you can make more money by selling your own half-brother into slavery than you can by murdering him. He next features in chapter 44, where he offers his life in place of his half-brother Benjamin, who he thinks is guilty, and in doing so becomes a type of Christ.
In Genesis 38, Judah has three sons. The first one, Er, marries a girl called Tamar, but he dies. The second one, Onan, marries her in accordance with ancient custom, but he dies too because he is wicked. Judah won't let her marry the third son, and instead sends her back to her father. She recognises this as an abandonment, pretends to be a prostitute, and seduces Judah, taking his seal, staff and cord. It's also just the sort of story that would get decent viewing figures on daytime TV and sell quite a few books if it was turned into a novel well. Are we missing out by the way we try to sanitise the Bible and just present the "nice" stories. (Hint: the answer is yes).
In chapter 38, Judah is good at calling others to fulfil their responsibilities, even his own son Onan (v8-9), who fails because he doesn't want to endanger his own inheritance. But Judah himself fails to fulfil those same responsibilities because he doesn't want to endanger his own inheritance (v11, 14).
Tamar tricks Judah into sleeping with her. This leads to Judah pronouncing the death sentence on her, and then we get the stunning denoument.
About three months later Judah was told, "Your daughter-in-law Tamar is guilty of prostitution, and as a result she is now pregnant."
Judah said, "Bring her out and have her burned to death!"
As she was being brought out, she sent a message to her father-in-law. "I am pregnant by the man who owns these," she said. And she added, "See if you recognize whose seal and cord and staff these are."
Judah recognized them and said, "She is more righteous than I, since I wouldn't give her to my son Shelah."
In the space of just two verses, Judah goes from saying "put her to death" to saying "she is more righteous than I". He understands for the first time just how much of a sinner he is, and that realisation transforms him.
It frees him to forgive Tamar. It frees him to offer his life for Benjamin. Little though he knows it, it enables him to become the ancestor of both David and Jesus, because they were descended from the twins that Tamar was carrying!
God reaches into the messy, mucky situation of this world, and uses it to transform Judah, to bring status to Tamar, and ultimately to redeem the world. That's the sort of God we serve and worship!/p>