I don’t THINK that Scripture tells us that God told Moses what to do. Could it not be that Moses, a fallible man, permitted something in the law that was wrong, and which Jesus was now correcting? There is precedent for that, in that Jesus spoke earlier saying, “you have heard that the law says X, BUT I TELL YOU Y”. . .usually making matters ‘harder’ if you will. So if the law had kowtowed and fallen off, it was quite logical that Jesus would have (rightly) pointed out that the law had ‘gone off the rails’ when lawgivers ‘gave in’ to societal demands, but that GOD decreed something different.