Doesn't mean they were right!
No, I agree with you here.
However, in Spock's case, I think it fit the trope of him speaking in mathematical jargon or something akin to "computerese" all the time. In Palmer's case, not so much. "No, sir," would have been more appropriate in her case.