Logic isn't an end in itself; it's a method to obtain progress towards a certain goal. In The Tholian Web, presumably Spock lies because it is in accordance with a larger goal to do so. If Spock values his alliance/truce (however temporary) with McCoy, he will do what is logical to protect it. Here, the logical thing to do was to present a united front to Kirk. It also prevented any further conversation into emotions/personalities/friendships, which sounds right up Spock's alley.
As for Vulcans never lying, it's likely because lying is very often an illogical step. Open communication and honesty in a society speeds progress and makes life more efficient. It is also logical to spread such a rumor across the universe as a tactical war tool, exactly as we saw in the episode with Miranda and Kollos.