In Matthew 22:24, the Sadducees referred to a Jewish tradition (see Deuteronomy 25:5-10) when they tried to trick Jesus. This custom to provide offspring for a dead man dated back to before the law of Moses, and still exists today among orthodox Jews. Judah demanded that his son Onan comply with this tradition to provide offspring for his dead brother Er. But God would not allow the ancestry of the kings of Israel to pass through these wicked men. Instead, God made other arrangements, and the strange story of Genesis 38 became very important to God’s plan to build the nation of Israel, and bless all nations through the Messiah.