6 “When the wicked man departed from me, I knew him not”. I approved him not, I praised him not, he pleased me not. For we find the word “to know” occasionally used in Scripture, in the sense of “to be pleased.” For what is hidden from God, brethren? Does He know the just, and does He not know the unjust? What do you think of, that He does not know? I say not, what do you think; but what will you ever think, that He will not have seen beforehand? God knows all things, then; and yet in the end, that is in judgment after mercy, He says of some persons: “I will profess unto them, I never knew you; depart from Me, you workers of iniquity.” Was there any one He did not know?
But what means, “I never knew you”? I acknowledge you not in My rule. For I know the rule of My righteousness: ye agree not with it, you have turned aside from it, you are crooked. Therefore He said here also: “When the wicked man departed from Me, I knew him not.”...Therefore, “when the wicked man departed from me,” that is, when the wicked man was unlike me, and was unwilling to imitate my paths, was unwilling in his wickedness to live as I had proposed myself for his imitation; “I knew him not.” What means, “I knew him not”? Not that I was ignorant of him, but that I did not approve him.
Source: The Enarrations, or Expositions, on the Psalms (New Advent)