Since those asking Jesus this question are Pharisees who are wanting to test Him, as to what position He holds (19:3), we can ask the question, "To what debate about the issue are the Pharisees referring?"
Many scholars have noted the debate among the two major schools of thought on the subject of divorce and remarriage between Shammai and Hillel. The first was that of Hillel, who held that the ‘ervat dābār “an issue with [her] nakedness,” in Deuteronomy 24, for which one could divorce his wife, was any unpleasing thing about her, including the burning of one’s food. The other was the school of Shammai, which was a far more rigid school of thought that saw the “issue with [her] nakedness” through the lens of the prophets, like Jeremiah, where God is said to have divorced his people because of their adulteries. Hence, the school concluded that adultery was the only legal cause for divorce and remarriage.
It is important to understand that, despite the claims of some, the vast majority of Pharisees in Jesus’ day were of the school of Shammai, and the ones who are interacting with Jesus in order to trap Him are all likely of the Shammaitic school. This can be concluded for numerous reasons.
First, in the Book of Acts, Gamaliel, the grandson of Hillel, attempts to urge the more violent Shammaitic school that they should not harm the apostles. The Hillel tradition was a non-violent tradition that believed God would take care of their enemies and that, as long as they were allowed to study the Torah, no violent action should be taken against foes. Those of the school of Shammai, however, were much more given to the view that the Jews should take violent action against their enemies. This is seen in much of the violent response to Jesus throughout His ministry, as well as the response of the Pharisees to the apostles in the Book of Acts, including the actions of Saul of Tarsus before his conversion. Even with Gamaliel giving his advice to the majority and persuading them not to kill the disciples, they still beat them.
Second to this, even though Gamaliel is of the school of Hillel, and Paul studies under him, scholars have noted that Paul clearly holds to the school of Shammai before his conversion. As just mentioned, he violently goes on a crusade against the preaching of the apostles likely due to their claim that the high priest had betrayed and killed the Messiah (Acts 2-3). It is likely to suggest that the school of Shammai was so much more in the majority that Saul was persuaded by the larger school even though his teacher was a Hillelite.
Finally, those within the school of Hillel were open to Hellenism and working with the Romans. They were largely pacificists when it came to Rome; but the school of Shammai was not. We see the true influence of this school as the majority in the fact that it eventually led the Jews into a revolt sanctioned by the majority of the Pharisees. In fact, it was the devastation of Jerusalem that later led Jews to switch to the school of Hillel as the dominant school, simply because they blamed the overly strict views of the school of Shammai as leading to the destruction of the city and the massacre of many Jews.
Many scholars have mistakenly thought that because the Mishna and later Judaism has tendencies toward the Hillelite school of thought, or at least is more open to it as a viable option, that this means the Pharisees were more of that type of thinking. However, the Mishna and later Judaism is evidence of a switch that took place due to a disdain for the more rigid Shammaitic school of thought that brought Judaism into conflict with the Romans and brought the city to its ruin. Hence, the evidence is more clear that the Pharisees, before A.D. 70, largely held to the ideas of Shammaitic school. Josephus, a representative of the Pharsaic majority before A.D. 70, is also of the Shammaitic school (Finkelsten 1938).
Why is this important? First, it is important to note that if Jesus was saying what the majority opinion stated, there really should be no shock at all over His position. Second, the fact that both of these are positions are held by various rabbis in the culture with which both the Pharisees and likely the disciples would be familiar, there should also be no shock in what Jesus says.
However, the response of both the Pharisees and the disciples indicate that Jesus is not confirming one of their common opinions, but rather is stricter than both.
First of all, the Pharisees respond to Jesus, not by debating the nature of the ‘ervat dābār in Deuteronomy 24, as one would expect if Jesus was merely giving them an alternate cause for divorcing one’s legitimate spouse and marrying another. Instead, their response is not to debate the meaning of the passage, but to bring up the passage’s existence in the first place. They respond by stating that Moses permitted them to get a divorce, finding themselves now in the position of needing to give an apologetic for why divorce and remarriage is permissible at all.
Jesus responds that this command/permission was only due to their stubbornness, not because divorce is a morally legitimate action. If the existence of the command is due to rebellion, then one must conclude that there is no viable reason for the command for those who want to follow God’s ultimate will for marriage.
This can only mean that Jesus’ statement was implying that a divorce was never to take place, and if it did, and one marries another, the divorced person is actually committing adultery. Hence, His statement “that which God has joined together, no man is to separate” is an absolute claim that challenges the entire debate over reasons for divorce.
Second to this, the reaction of the disciples makes no sense if Jesus gives an out from a legitimate marriage. They state that if a couple is like this, i.e., inclined to get a divorce, it is better not to marry at all, since one can steer clear of the sin of adultery altogether by avoiding the institution in such situations.
Jesus’ further response is not to negate what the disciples conclude, but to affirm it by saying that not everyone can accept it, but that there are those who remain celibate for the sake of the kingdom of God.
None of these responses make sense if Jesus is simply saying that one can get a divorce in the case of adultery, since that is a commonly held view, and indeed, the most commonly held view by the people to whom Jesus is speaking.
Instead, it is clear from their rebuttal that Jesus has prohibited any divorce and remarriage, and hence, the debate shifts from the meaning of the ‘ervat dābār clause in Deuteronomy 24 to the fact that Moses permitted/gave commandment that they could get a divorce. Jesus gives the command that no man is to separate what God has joined together, and states that the previous allowance was not in continuity with what God had said in Genesis, but rather a concession due to their stubborness. This all implies, therefore, that Matthew is not negating the earlier teaching of the New Testament, but is instead affirming it. Hence, the porneia exception clause cannot be talking about the dissolution of a legitimate marriage, since he would then just be presenting Jesus as agreeing with the Shammaitic Pharisees. Instead, he negates this idea, which is likely an idea popping up in the church among the antinomians, that divorce and remarriage is something that may characterize a true disciple of Jesus. The righteousness of the Pharisees, according to the teaching of Jesus in the Gospel of Matthew, is not the righteousness Jesus' followers are to pursue. Instead, he calls them to a full understanding of the law as love toward God and one another, and abandoning one's partner, which is to leave a relationship broken rather than restored, is not a part of that picture.