The highly contrived story of the seven brothers all marrying one widow was specifically concocted by the Sadducees ("*who say there is no resurrection*", Matt 22:23, Mark 12:18, Luke 20:27, Acts 23:8) in an attempt to show that the resurrection from the dead is inconsistent with the sacred teachings of the Torah.  Thus, it was an attempt at entrapment, see V15 & 34.

Thus, their logic would have gone something like this:
 - The Torah requires that a widow marries her brother-in-law.  This could happen, say, seven times
 - **IF** there is a resurrection, she will have been married to multiple men and thus, after the resurrection will have multiple husbands
 - Such is not permitted by the Torah
 - Therefore, the doctrine of the resurrection must be wrong

The Latin name for such an argument is "*reductio ad absurdum*".

Thus, their question was designed to trap Jesus and show that what He was teaching about the resurrection was not consistent with Torah.

**APPENDIX - The Four Questions/Riddles of Matt 22**

Note that Matt 22 contains a series of question posed by different groups with the sole intention of silencing Jesus by logical entrapment, V15 & 34.  Finally Jesus poses a question that silences His attackers.
 - V15-22 - Pharisees ask about paying taxes to Caesar
 - V23-22 - Sadducees ask about marriage after the resurrection
 - V34-40 - Pharisees ask about the greatest commandment
 - V41-46 - Jesus asks about the Christ - Whose Son is He?