Is it a sin to lust?
Lust is a sin because the, felling of want is bad for the soul,
and if you want more than what God can provide that is also a bad
thing
Answer
The word lust is usually associated with the lusts of the flesh,
which includes sexual lust. No doubt this is the lust you are
referring to. However the word can have another meaning i.e having
a craving, appetite, or great desire for more wisdom or knowledge.
But as you are referring to the lust of the flesh as David did for
Bathsheba, then yes it is a grievous sin.