The Gospel teaches man needs to ideally live by the spirit, but what does that mean?
To me, it means this:
"God said, 'Thou shalt not kill;' at another time he said 'Thou shalt utterly destroy.' This is the principle on which the government of heaven is conducted -- by revelation adapted to the circumstances in which the children of the kingdom are placed."
(Teachings of the Prophet Joseph Smith, page 256.)
So, there are not as many absolutes of right and wrong that we might imagine there are.
It all depends on the circumstances. If we live by the spirit, few of the commandments may be absolutes ... we simply need continual revelation to know the exceptions when they come
And, Christ will likely judge us by the intent of our hearts, as well as the circumstances, more than by the absolute letter of the law.
But we can't take things too far and bend this "adapted to the circumstances" doctrine to try and vainly justify sin or vain ambition either.