Here we have, 1. David's dread of the risings of sin, and the first
beginnings of it: I hate vain thoughts. He does not mean that he hated
them in others, for there he could not discern them, but he hated them
in his own heart. Every good man makes conscience of his thoughts, for
they are words to God. Vain thoughts, how light soever most make of
them, are sinful and hurtful, and therefore we should account them
hateful and dreadful, for they do not only divert the mind from that
which is good, but open the door to all evil, Jer. iv. 14. Though David
could not say that he was free from vain thoughts, yet he could say
that he hated them; he did not countenance them, nor give them any
entertainment, but did what he could to keep them out, at least to keep
them under. The evil I do I allow not. 2. David's delight in the rule
of duty: But thy law do I love, which forbids those vain thoughts, and
threatens them. The more we love the law of God the more we shall get
the mastery of our vain thoughts, the more hateful they will be to us,
as being contrary to the whole law, and the more watchful we shall be
against them, lest they draw us from that which we love.