The passage in question is Mark 12:18-23 (ESV):
And Sadducees came to him, who say that there is no resurrection. And they asked him a question, saying, “Teacher, Moses wrote for us that if a man's brother dies and leaves a wife, but leaves no child, the man must take the widow and raise up offspring for his brother. There were seven brothers; the first took a wife, and when he died left no offspring. And the second took her, and died, leaving no offspring. And the third likewise. And the seven left no offspring. Last of all the woman also died. In the resurrection, when they rise again, whose wife will she be? For the seven had her as wife.”
Mark makes clear that the Sadducees are questioning Jesus about resurrection. Perhaps they are trying to trick him or maybe they want to test his orthodoxy (according to the Sadducee system, of course). The scenario seems unusual, but as they say, it was commanded by Moses in Deuteronomy 25:5 (ESV):
If brothers dwell together, and one of them dies and has no son, the wife of the dead man shall not be married outside the family to a stranger. Her husband's brother shall go in to her and take her as his wife and perform the duty of a husband's brother to her.
So the Sadducees take the example from the Torah and push it to extremes (seven men instead of just two). Therefore, if the resurrection occurs, one woman will have seven possible husbands. If polyandry is no problem, I don't see how the question is an issue: she has seven husbands in the resurrection. But if polyandry (particularly the fraternal variety) is sinful, the question has bite.
Can we also say by extension that polygamy was considered sinful (either by the Sadducees or their opponents) or is that a bridge too far?