Countless times we have heard Spock say that he cannot tell a lie.
Untrue. The one and only time Spock has actually said "Vulcans cannot lie" onscreen was in
Star Trek Into Darkness (unless he's said it in
Strange New Worlds, since I don't know where to find transcripts for that). In "The Doomsday Machine," he did say "Vulcans never bluff," but that's not quite the same thing. In "The Enterprise Incident," the Romulan Commander asked "There's a well-known saying, or is it a myth, that Vulcans are incapable of lying?", to which Spock replies "It is no myth." That's an ambiguous statement at best, and Spock said it during a spy mission where he was
unambiguously lying to the Romulan Commander throughout the entire episode, so we obviously were not meant to take him at his word. There were his exchanges with Saavik and Valeris in the movies, where he handwaved his outright lies as exaggeration and error, but again, we obviously were not meant to take his rationalizations literally; on the contrary, they were deadpan humor.
Beyond TOS, in DS9: "The Maquis Part 2," Gul Dukat skeptically asks "Because Vulcans don't lie?" and Sisko replies "As a rule, they don't" -- confirming implicitly that there are exceptions to that rule. Otherwise, ENT: "Shadows of P'Jem" mentions Vulcans' "reputation for truthfulness," but that's part of a story arc involving the Vulcan government illegally spying on Andoria.
As Archer said in ENT: "The Forge," "Vulcans can lie and cheat with the best of them." As a cultural norm, they prefer to report information accurately and advance a rational, unbiased, fact-based understanding of the universe, hence their reputation for truthfulness; a lack of concern for others' hurt feelings may be a factor in their lack of deception as well. But they are as capable of anyone else of engaging in deceit when they have a reason to do so.