Eventually Judah hears that Tamar has behaved in a scandalous way. In his hypocrisy he conveniently forgets about the beam in his own eye, and dares to judge her.
Our sins have ways of finding us out that are beyond our ability to anticipate or avoid. How much better to have the providence of God working for us and not against us! Tamar set a trap for Judah, but it was God who trapped him in his wickedness. However, by the grace of God, something good was going to come out of this that no one could have anticipated.