Judah was immoral (see Genesis 38) but he is listed in the lineage of Jesus Christ (see Matthew 1:2). Was there no one better than Judah?
Why did God use him? There is none righteous, not even one (Romans 3:10). We are all unworthy servants (Luke 17:10).
Jesus said, “I am the way, and the truth, and the life. No one comes to the Father except through me” (John 14:6).