Summary: Jesus had to answer some very complicated questions designed to trap Him. But being the master chess player, Jesus turned the traps into times of teaching and revealing much about His true identity.
Jesus is in the middle of debating the religious leaders who have come to challenge Him after He cleared the Temple. Last time they demanded that He prove His authority (He wouldn’t because they wouldn’t admit where John the Baptist got his authority) and then they tried to trap Him about whether to pay taxes or not. Now they bring some thorny theological questions to Him as the tag team approach becomes almost desperate to land any punch on Jesus.
The Sadducees were rationalists, where the Pharisees were moralists. These are the two main groups that still exist today. A moralist might admit that there is a God, but reaching Him is up to our efforts and our measures. A rationalist needs proof they can see and doesn’t have any room in their philosophy for the supernatural. The Sadducees were enemies with the Pharisees and we see several places in the New Testament where people like Peter and Paul were able to leverage their theological differences to their advantage.
The Sadducees believed only in the Pentateuch, the first five books of the Bible. Because they could not find anything there that gave them the idea of a resurrection from the dead, they rejected the idea altogether. They also rejected anything supernatural including angels. The Pharisees expected there to be a cataclysmic restoration by the Messiah. The Sadducees favored working with the Romans to achieve earthly wealth.
The Law they quote is from Deuteronomy 25:5-6 (quickview)  which states basically that if a man dies before having a son, his brother or the nearest male relative is to marry the widow and the first son is technically the heir of the dead man—making sure that Israelites didn’t lose their property. We see this, called the levirate law (for “brother-in-law”), working in the book of Ruth, for instance. It was designed to protect the widow, who in that culture had no rights.
It seems that perhaps this argument was a stock one the Sadducees had used to great affect against the Pharisees in debates. So they pull it out here trying to embarrass Jesus. It’s odd, of course that they mention the resurrection at all, but it was to show the ridiculousness of believing in the afterlife. It is the question that was ridiculous and unfair. I find that people will often ask these kinds of questions like: could God make a rock so big even He couldn’t move it? What this tells me is that they are trying to side step the main issue, which is whether or not you are willing to put your faith trust and reliance in Jesus. As we talk about the things of God, it is important to stick to the main thing before moving on to the finer points of theology.
The problem of the Sadducees was that, being rationalists, they figured if there was a resurrection, it would only be a continuation of what they could see here on earth: that suddenly there would be seven husbands and one wife. The Sadducees had made God in man’s image—there was no room in their minds that God could both resurrect people and give them a new, different life.