While elsewhere in Scripture we are told that God hates a lying, deceitful tongue, this commandment specifically addresses witnesses. (Pr. 24:26)
And there is a vast difference between "Thou shalt not lie" and the condemnation of a lying tongue and a deceitful heart.
There are times to lie! There is never a time to be a liar. Just as there are times to kill, but never to be a murderer.
Look at the examples in Scripture of those who deceived the wicked for The Glory of God- and indeed, in obedience to God:
- Jehu pretended to serve baal so that he could rid the land of servants of baal. (2 Kings 10)
- Rahab lied to save the Hebrew spies (Joshua 6)
- Ehud used deciet to come before Eglon. (Judges 3)
- The Hebrew midwives lied to save Hebrew babies- and God blessed them for it! (Exodus 1)
Let us be shrewd...