"Hate your enemies" refers to Deuteronomy 23:3-6. "never seek their peace or prosperity" - never make a treaty or alliance with them. But what does it mean by "none of their descendants shall enter the assembly of the LORD"? The assembly of the LORD is the gathering where community decision making took place. I.e. the Moabite or Ammonite could not "vote". (I had the question of whether David could enter the assembly of the LORD being less than 10 generations from Ruth.)
Jesus' instruction to love your enemies is not new, or foreign to the Torah. The Torah says the same, in Exodus 23:4-5, in Proverbs 25:21, and many other places. So where and why did the "tradition of the elders" start? Susan Preston summarizes it this way:
“It has been said that in an effort to prevent this [captivity] happening again, the sect of the Pharisees ‘arose’. Their original purpose was to prevent people from breaking God’s laws, including the Sabbath.It developed into Judaism. Judaism is not the ‘religion of Moses’ as is generally assumed.
From ‘A history of the Jews’ by Paul Johnson – Judaism dates from the time just after the Babylonian exile.
American Rabbinical scholar Stephen S Wise stated, ‘The return from Babylon… marked the end of Hebrew-ism and the beginning of Judaism.”