Not when God ordains it.
Jos 2:1 And Joshua the son of Nun sent out of [bless and do not curse][bless and do not curse][bless and do not curse][bless and do not curse]tim two men to
spy secretly, saying, Go view the land, even Jericho. And they went, and came into an harlot's house, named Rahab, and lodged there.
And God approves of the use of secretive spying.
Let's further look at the definitions:
spy
H7270
???
ra^gal
raw-gal'
A primitive root; to walk along; but only in specific applications, to reconnoitre, to be a tale bearer (that is, slander); also (as denominative from H7272) to lead about: - backbite, search, slander, (e-) spy (out), teach to go, view.
H7270
???
ra^gal
BDB Definition:
1) to go on foot, spy out, foot it, go about, walk along, move the feet
1a) (Qal) to be a tale-bearer, slander, go about
1b) (Piel)
1b1) to slander
1b2) to go about as explorer, spy
1c) (Tiphel) to teach to walk
Part of Speech: verb
A Related Word by BDB/Strong’s Number: a primitive root
Same Word by TWOT Number: 2113
Jos 2:3 And the king of Jericho sent unto Rahab, saying, Bring forth the men that are come to thee, which are entered into thine house: for they be come to search out all the country.
Jos 2:4 And the woman took the two men, and hid them, and said thus, There came men unto me, but I wist not whence they were:
Jos 2:5 And it came to pass about the time of shutting of the gate, when it was dark, that the men went out:
whither the men went I wot not: pursue after them quickly; for ye shall overtake them.
Rahab lies to the men! Does God shun her or punish her for sinning? No, she has protected spies that ultimately are working for God for the benefit of Israel and she and her family are rewarded by being allowed to survive. God approves of her lying because it helped his spies survive and do their job.
In Numbers 13 Moses does much the same as Joshua, sending in spies to a land to scout out how strong they are because Moses wanted to invade.
1Sa 21:13 And he changed his behaviour before them,
and feigned himself mad in their hands, and scrabbled on the doors of the gate, and let his spittle fall down upon his beard.
Here another form of non-verbal lying is being used by David to feign or pretend that he is crazy when he in fact is not. It's not true that he was "mad" but it served a good and righteous purpose because it saved his life and assured all that God had planned for him would come to pass.