They'll only lie if it seems logical to them. But they aren't computers with nand and nor gates. They
can lie. They just don't do it compulsively for no reason.
Spock essentially ordered Scotty to lie in TUC.
"Mr. Scott, I understand you are having trouble with the warp drive. How long do you require for repair?"
"there's nothin' wrong with the bloody thing--"
"Mr. Scott, if we return to spacedock now...we will never see the Captain or Dr. McCoy again."
"...Could take weeks sir."
"Thank you Mr. Scott. Valeris, please inform Starfleet that our warp drive is inoperable."
"A lie?"
"An error."

Suuuuure Spock, an 'error' *wink wink*, you lying bastard! See, he was playing that game so they wouldn't all end up in chains when they returned to Earth. He didn't make the 'error' excuse to sooth his own guilt, only to make sure his nose was 'clean' if he got dragged into a military court to explain his actions.
See, Vulcans are like Lawyers. They can get out of being called liars on technicalities. Like Bill Clinton and his 'misleading' comments.

Gotta love it.