“The Sermon on the Mount was directed to “the crowds,” not to the Pharisees in particular.”
When Jesus prefaced his arguments with, “You have heard it said”, from whom did the crowd hear such things?
“The idea that Judaism focuses or focused only on the external is based in an ignorance of Judaism’s actual teachings.”
Nearly all, if not all, of Jesus’ polemics against the Pharisees was because of their externalism.
Look, I realize that it's been fashinable for two millennia to blame everything on the Pharisees, but the fact is that they were not the only game in town until after the fall of the Second Temple. Their teachings were competing with those of the Sadducees, the Essenes, the Zealots, the Hellenists, and probably a few dozen small groups that we've never heard of. The situation was so confused that Stephen Wylen, author of Jews in the Time of Jesus has pointed out that one pretty much has to refer to 1st Century Judaism in the plural to be accurate.
If you want to know what the Pharisees actually taught, you might try consulting a Jewish source.
My own hypothesis is that "hate your enemy" came from the teachings of the Zealots, who were famous for, among other things, assassinating Jews whom they thought were getting too buddy-buddy with the Gentiles.
People need to stop assuming that the New Testament is intended to give one a crash-course on 1st Century Judaism. Rather, the NT assumes that its audience already has at least a passing familiarity with the synagogue, its services, its liturgy, and its theology.
Shalom.
The context makes it clear:
For I say to you, that unless your righteousness exceeds the righteousness of the scribes and Pharisees, you will by no means enter the kingdom of heaven. (Matt. 5:20)
It is the perverted teaching of the scribes and Pharisees (the teaching class in Israel) that gets Jesus attention here, and in much of the NT. E.g., Hate your enemy was their inference from the silence in Lev. 19:18.