For thou [art] not a God that hath pleasure in wickedness
Sin, ungodliness; it is contrary to his nature, who is holy, just, and good; and to his will revealed in his law, which is the same with his nature; and sin is a transgression of it. God is so far from taking pleasure in sin, that it is the abominable thing which his righteous soul hates; though this hinders not his voluntary permission of sin, or his decree of it; which he has willed, though he does not delight in it, in order to magnify the riches of his grace and mercy in the salvation of his people: nor is this contrary to the delight and pleasure which he takes in the persons of his elect in Christ, though they are sinners in themselves, and were so when he so loved them as to give his Son for them, and who died for them while they were yet sinners; and when he sends his Spirit to regenerate and sanctify them, and are after conversion guilty of many sins: for, though he delights in their persons, he has no pleasure in their sins; nor is it consistent with the holiness of his nature to take pleasure in wickedness, let it be committed by whomsoever;
neither shall evil dwell with thee;
that is, the evil man, who continues in a course of wickedness, and lives and dies in his sins. He has no communion with God here, nor shall he dwell with him hereafter; but shall be bid to depart from him, whether he be a profane sinner openly, or secretly a wicked professor of religion. The sense of the psalmist is, that since they were evil and wicked men, that were risen up against him, and gave him trouble, he entertained a strong confidence that God would hear him, for himself and his friends, whose cause was righteous; and appear against his enemies, who were wicked and ungodly men; and this he grounded upon the purity and holiness of God.