One of the major problems in seeing Jesus as siding with the school of Shammai is that the school of Shammai was clearly wrong about their interpretation of the ‘ervat dābār in Deuteronomy.
This is made clear because the laws that deal with discovering that one's wife is an adulteress, either on one's wedding night or thereafter, command, not that she be divorced, but that she be put to death for it (Deut 22:13-24). Notice that if he cannot prove her adultery, he must remain married to her and is explicitly prohibited from divorcing her. Hence, Deuteronomy 24:1-4 cannot be talking about adultery.
This means that the Shammaitic school was wrong, and if Jesus joined them in their interpretation He would have also been wrong.
The Hillelite understanding of the ‘ervat dābār was likely closer to the original meaning, but not the original intent. The original meaning likely referred to the idea that the man did not find the woman attractive once he saw her naked.
This law, as many of the laws in Deuteronomy is a case law. The case that is found in the protasis is not expressing the moral will of God, but a case of someone usually doing the opposite of God's will. It is the clause of the criminal or the oppressor. The apodosis is the clause of the victim. This is the moral will of God expressed as to what the law should do for a victim who has suffered some loss. The law was never meant to convey the idea that God's moral will permits divorce anymore than the laws describing cases of rape, the killing of one's sons, servants, or oxen somehow convey God's moral will that these are OK too.
In other words, they were asking the wrong question of the text. The text should not have been read in terms of what is technically permissible; but what is the good and loving thing to do for the victimized woman in a situation where a man has abandoned his wife.
Furthermore, because they read it this way, they were reading the clauses, "and he draws up a divorce document, gives it to her, and evicts her from his house . . ." as part of the apodosis, describing what a man should do, rather than as part of the protasis that explains the injustice being done. It can be read either way, but the waw's are not disjunctive, and since they describe the actions of the man against the victim, they should likely be read as part of the protasis.
What this means is that the law is not commanding the man to give her a divorce if he doesn't like something about her. Instead, it is only implying that the only prohibition thus far in God's law for one who divorces his wife is that he is not allowed to remarry her once she is joined to someone else.
This also means that Jesus is not contradicting this law, but adding that the injustice it describes in its protasis should not be done, and that Moses permitted/gave the commandment that he did, a commandment that did not prohibit divorce altogether, because of their stubbornness. However, Jesus, who is now filling up the law, calls His disciples to love more fully.