St Augustine wrote that phrase. He was showing how you can love your enemies which is what Christ taught. So it is from Christ as an analogy of the how to love your enemies. Love the sinner hate the sin. Of course it’s spiritual love not an unnatural.
Who were Christ's most ardent enemies while he walked the earth? Without any doubt, the Jewish religious leaders ("the Jews," in most translations) were his enemies. And yet, Christ excoriated them time and time again, calling them snakes and vipers, whitewashed sepulchers, and sons of the Devil. Love? You betcha! Not the namby-pamby "love" that's so in vogue nowadays.
If we could only do as well in following His example.
Christ didn’t “teach” this. At best you can argue that Jesus showed grace and mercy to the lost. However, this phrase is horribly used as a mechanism to blunt condemnation of sinful behavior. Christ was very clear that “sin is sin” and that we are to turn from our sinful natures. We are under no command to welcome sinful behavior in those who relish in their acts. Christ’s command is to “go and sin no more”. We are to lovingly share the Gospel with the lost...but if people refuse it, we are perfectly justified in refusing to associate with them. Jesus said in Matthew 10:14-14 “If a village doesn’t welcome you or listen to you, shake off the dust of that place from your feet as you leave. I assure you, the wicked cities of Sodom and Gomorrah will be better off on the judgment day than that place will be.”