17 Sisera ran away to the tent of Jael, the wife of Heber the Kenite, because King Jabin of Hazor was at peace with Heber’s family.
18 Jael went out to meet Sisera and said to him, “Come in, sir; come into my tent. Don’t be afraid.” So he went in, and she hid him behind a curtain.
19 He said to her, “Please give me a drink of water; I’m thirsty.” She opened a leather bag of milk, gave him a drink, and hid him again.
20 Then he told her, “Stand at the door of the tent, and if anyone comes and asks you if anyone is here, say no.”
21 Sisera was so tired that he fell sound asleep. Then Jael took a hammer and a tent peg, quietly went up to him, and killed him by driving the peg right through the side of his head and into the ground. – Judges 4:17-21
Here is another story in the Old Testament which endorses lying. In Judges 4, the Israelites had fought so that they were freed from the Canaanites, and YHWH delivered the Canaanites into Israel’s hand. Here is the important part: Sisera, the captain of the Canaanite army, ran away to the tent of Heber, because there was peace between Jabar, the King of canaan and Hebar. The wife of Hebar, Jael, promised Sisera safe sanctuary in her tent from the Israelites. However, when Sisera was in deep sleep, Jael murdered him. Moreover, this situation did not come into place without the help of YHWH – let’s read further:
“Very well,” she replied, “I will go with you. But you will receive no honor in this venture, for the LORD’s victory over Sisera will be at the hands of a woman.” So Deborah went with Barak to Kedesh. Judges 4:9
In the above verse, we can see that YHWH was involved in some way in Sisera’s death. In addition, Jael is praised in Judges 5:
“Most blessed among women is Jael, the wife of Heber the Kenite. May she be blessed above all women who live in tents.” – Judges 5:24
What this shows is that sometimes lying is the right thing to do, according to the Bible. The silence of YHWH in rebuking Jael proves that lying is allowed, endorsed in the Bible.
Judges: A Practical and Theological Commentary – James B. Jordan
… Jael is charged with violating the law or conventions of hospitality. Hospitality is important in scripture, and it is clear enough that normally we are not to murder our guests! The New Testament, however makes it clear that we do not show hospitality to the enemies of God (2 John 10). God comes first, hospitality second.
…, Jael is charged with murder. In reply we simply point out that killing in wartime or on a battlefield is not murder. As the war of humanistic Satanism against Christianity grows more and more severe in our day, especially in the attacks on Christian schools, serious Christians need to consider ways to deceive the enemy. Vigilante-style lynching, assassinations, and murders are not permitted in the Bible; killing, such as Ehud’s and Jael’s, is permissible in time of war, but not in vigilante form. On the other hand, deception and lying are authorized in scripture any time God’s kingdom is under attack. The protestant Reformers travelled throughout Europe under false names and with faked papers. They were not the first or the last Christian preachers to deceive tyrants, either. If we have to deceive and lie to bureaucrats in order to keep our churches and schools running, we must do so freely and with relish, enjoying the opportunity to fight for the Lord. 
Albert Barnes’ Notes on the Whole Bible
If we can overlook the treachery and violence which belonged to the morals of the age and country, and bear in mind Jael‘s ardent sympathies with the oppressed people of God, her faith in the right of Israel to possess the land in which they were now slaves, her zeal for the glory of Yahweh as against the gods of Canaan, and the heroic courage and firmness with which she executed her deadly purpose, we shall be ready to yield to her the praise which is her due. See Judges 3:30 note. 
Joseph Benson’s Commentary of the Old and New Testaments
4:18-19. Jael said unto him, Turn in, my lord — If Jael now intended to betray and deliver him to Barak, or otherwise to injure him, her addressing him in this manner was dissimulation and treachery, and is not to be excused. But it is highly probable that she had now no other intention toward him, in inviting him into her tent, than merely to afford him that shelter and protection which he sought of her, and such relief and refreshment as she would have afforded to any weary and distressed Israelite. Accordingly she covered him with a mantle, that he might take rest in sleep, and when he asked for a little water to drink, because he was thirsty, she opened a bottle of milk and gave him drink. In what she did afterward she seems to have been actuated by a divine impulse or suggestion, of which she had beforehand neither thought nor conception. God, it must be remembered, had foretold by the prophetess, not only before the battle, but before the enterprise to shake off the yoke of Jabin was undertaken, that he would deliver Sisera “into the hand of a woman,” 4:9. This method then, God, who is wise in all his ways, and holy in all his works, took to accomplish this prediction. He brought Sisera to Jael’s tent, disposed her mind to invite him in, and when he lay sunk in sleep, powerfully suggested to her mind what before was the very reverse of all her thoughts, namely, to take his life, and that in a way so very singular and unprecedented, that one can hardly suppose she would ever have thought of it, had not God put it into her mind, and impelled her to it. Bishop Patrick justly observes, “she might as well have let Sisera lie in his profound sleep till Barak took him, if she had not felt a divine power moving her to this, that the prophecy of Deborah might be fulfilled.” Dr. Waterland is of the same opinion. “It can scarce be doubted,” says he, “but that Jael had a divine direction or impulse to stir her up to this action. The enterprise was exceeding bold and hazardous, above the courage of her sex, and the resolution she took very extraordinary, and so it has the marks and tokens of its being from the extraordinary hand of God.” Certainly, as Dr. Dodd remarks, “nothing but this authority from God could warrant such a fact, which seemed a breach of hospitality, and to be attended with several other crimes; but was not so when God, the Lord of all men’s lives, ordered her to execute his sentence upon Sisera. In this view all is clear and right, and no objectors will be able to prove there was any treachery in it: for she ought to obey God rather than man; and all obligations to man cease, when brought in competition with our higher obligations toward God.” And that this is the true view of the action appears still more evident from the celebration of it by Deborah the prophetess, in a hymn or song of solemn praise and thanksgiving offered to God on the occasion of it: see 5:24-27. In Dr. Leland’s answer to Christianity as Old as the Creation, p. 2, and in Saurin’s 11th Discourse, vol. 3, the reader will find a more complete justification of this affair. 
L. M. Grant’s Commentary on the Bible
Then he instructed her to stand at the tent door while he slept, and to lie to anyone who might come to ask if any man was in the tent (v. 20). But she had no such intention. Instead, while he was asleep, she took a tent peg and a hammer and drove the peg through his temple so powerfully that the peg pierced into the ground below (v. 21). If her action had been with selfish motives, this would have been murder, but since Sisera was an oppressor of the people of God and it was a time of war, the Lord approved of her killing this enemy of God. 
David Guzik Commentary on the Bible
a. Sisera had fled away on foot to the tent of Jael, the wife of Heber the Kenite: Here the story takes an unexpected turn. God promised (Judges 4:9) that a woman would defeat Sisera. We would logically assume that this would be Deborah, but God had something else in mind. He will use the wife of a Kenite to accomplish Sisera’s end.
b. Turn aside, my lord, turn aside to me; do not fear: Because there was peace between the people of Sisera and the people of Jael, he had reason to believe he could trust Jael’s invitation.
i. In addition, “Any pursuer would hardly think to look in a woman’s tent for any man, let alone a weary fugitive, for this would be a breach of etiquette.” (Cundall)
c. Drove the peg into his temple: The gory detail of this account supports the fact that this is an eye-witness account. Jael knew how to handle a tent-peg because it was customarily the job of women to set up the tents. She struck the peg so hard that it went down into the ground.
i. Jael broke a fundamental principle of hospitality, and many in the ancient world would think her a treacherous woman. She broke her promise to Sisera and killed a man that her own husband had made peace with.
ii. Yet God used even her treachery to accomplish His purpose. Surely, Sisera deserved to die; he fought against God’s people on behalf of a leader who had harshly oppressed the people of Israel (Judges 4:3). The lesson for us is important – God can make even the evil of man serve His purpose: Surely the wrath of man shall praise You (Psalms 76:10). Yet, that never diminishes the personal responsibility of the one doing the evil. Judas’ betrayal of Jesus served the eternal purpose of God, yet he still answered for that evil deed. 
Matthew Henry’s Complete Commentary on the Bible
4. When he lay fast asleep she drove a long nail through his temples, so fastened his head to the ground, and killed him, Judges 4:21. And, though this was enough to do the business, yet, to make sure work (if we translate it rightly, Judges 5:26), she cut off his head, and left it nailed there. Whether she designed this or no when she invited him into her tent does not appear probably the thought was darted into her mind when she saw him lie so conveniently to receive such a fatal blow and, doubtless, the thought brought with it evidence sufficient that it came not from Satan as a murderer and destroyer, but from God as a righteous judge and avenger, so much of brightness and heavenly light did she perceive in the inducements to it that offered themselves, the honour of God and the deliverance of Israel, and nothing of the blackness of malice, hatred, or personal revenge. (1.) It was a divine power that enabled her to do it, and inspired her with a more than manly courage. What if her hand should shake, and she should miss her blow? What if he should awake when she was attempting it? Or suppose some of his own attendants should follow him, and surprise her in the face, how dearly would she and all hers be made to pay for it? Yet, obtaining help of God, she did it effectually. (2.) It was a divine warrant that justified her in the doing of it and therefore, since no such extraordinary commissions can now be pretended, it ought not in any case to be imitated. The laws of friendship and hospitality must be religiously observed, and we must abhor the thought of betraying any whom we have invited and encouraged to put a confidence in us. And, as to this act of Jael (like that of Ehud in the chapter before), we have reason to think she was conscious of such a divine impulse upon her spirit to do it as did abundantly satisfy herself (and it ought therefore to satisfy us) that it was well done. God’s judgments are a great deep. The instrument of this execution was a nail of the tent, that is, one of the great pins with which the tent, or the stakes of it, were fastened. They often removing their tents, she had been used to drive these nails, and therefore knew how to do it the more dexterously on this great occasion. he that thought to destroy Israel with his many iron chariots is himself destroyed with one iron nail. Thus do the weak things of the world confound the mighty. See here Jael’s glory and Sisera’s shame. The great commander dies, [1.] In his sleep, fast asleep, and weary. It comes in as a reason why he stirred not, to make resistance. So fettered was he in the chains of sleep that he could not find his hands. Thus the stout-hearted are spoiled at thy rebuke, O God of Jacob! they are cast into a dead sleep, and so are made to sleep their last, Psalm 76:5,6. Let not the strong man then glory in his strength for when he sleeps where is it? It is weak, and he can do nothing a child may insult him then, and steal his life from him and yet if he sleep not he is soon spent and weary, and can do nothing either. Those words which we here put in a parenthesis (for he was weary) all the ancient versions read otherwise: he struggled (or started, as we say) and died, so the Syriac and Arabic, Exagitans sese mortuus est. He fainted and died, so the LXX. Consocians morte soporem, so the vulgar Latin, joining sleep and death together, seeing they are so near akin. He fainted and died. He dies, [2.] With his head nailed to the ground, an emblem of his earthly-mindedness. O curve in terram animæ ! His ear (says bishop Hall) was fastened close to the earth, as if his body had been listening what had become of his soul. He dies, [3.] By the hand of a woman. This added to the shame of his death before men and had he but known it, as Abimelech (Judges 9:54), we may well imagine how much it would have added to the vexation of his own heart. 
James Nisbet’s Church Pulpit Commentary
Jael appears to us as a hateful murderess; our feeling towards her is one of horror and indignation. Yet in the Bible she is extolled as amongst the noblest of heroes. The question is what vindication can be offered for her conduct? If Jael received Sisera into her tent with the intention of murdering him, she must be left to the execrations of posterity.
I. But there are plain and straightforward reasons from which to infer that Jael had no design of killing Sisera; that she acted therefore with perfect honesty, and not with atrocious duplicity, when she offered him shelter. The action was too perilous; it required too much of more than masculine hardihood, or rather ferocity, even if there had been the strongest inducements; whereas there appears to have been no inducement at all, but rather the reverse, and we add to this, that since you have only the silence of Jael when she was asked by Sisera to tell a lie in his cause, the probability is that she had a reverence for truth; and if so she must have meant what she said when she gave the invitation and the promise, ‘Turn in, my lord, turn in to me; fear not.’
II. What were the motives which instigated Jael in putting to death her slumbering guest?—We reckon it a satisfactory explanation of her conduct and one which removes every difficulty, that she was led by a Divine impulse or in obedience to a Divine command, to take away Sisera’s life. It is true we are not told, as in the case of Abraham, that God commanded the action, but we are told that God approved the action. And since the action in itself, independent of His command, would have been a flagrant offence, we necessarily infer that what He approved He also directed.
III. There is a third question which suggests itself here.—Granting that Jael acted on a Divine command, how could it be consistent with the character of God to issue such a command? Since murder is a crime which is expressly forbidden, with what propriety could He enjoin its perpetration? The answer is, that no one would have felt surprised had Sisera perished in battle. He was the oppressor of the Lord’s people; what marvel, then, that he should be overtaken by vengeance?
Jael was but the executioner directed by God to slay a condemned criminal, and can we charge her with bloodguiltiness because she did not refuse to obey that direction? She had a hard task to perform, one demanding faith and dependence on God, but she performed it without flinching, and she deserves our admiration as a mighty heroine. 
Sutcliffe’s Commentary on the Old and New Testaments
4:21. Jael—smote the nail into his temples. She evidently had disapproved of the covenant which her husband had made with Jabin, all such covenants being forbidden by the law. The deed of killing the oppressor of her country was glorious, as that of Ehud, and that of Judith. Her praise is celebrated by the prophets, whose hallowed songs we must not arraign; but the words and means she employed cannot without the greatest difficulty be defended.
The glory of this day was consummated by an illustrious deed of Jael. She still believing in JEHOVAH, and abhorring the league of her husband with Jabin, received the fugitive, but made him no promise of safety. She refreshed him with food, and covered his feet; but resolved that the glory of his fall should not be by another. Fearing nothing therefore from the husband, for whose crime she now atoned, and whose life she now saved; and fearing nothing from her own trembling hand, or from vengeance, in case she awoke the warrior; she took the iron pin of her tent, and piercing his skull with a single blow, left him fastened to the wood. Thus Deborah, inspired of God, planned the emancipation of her country, and Jael gave a finishing stroke to the glory of the day. When called to oppose iniquity let us neither consider our own weakness, nor be intimidated at the greatness, power, and number of the wicked. And the woman who abides in God, though her husband depart from him, may yet live to save her house. 
 Judges: A Practical and Theological Commentary By James B. Jordan Page 89 – 90
 Albert Barnes’ Notes on the Whole Bible
 Joseph Benson’s Commentary of the Old and New Testaments
 L. M. Grant’s Commentary on the Bible
 David Guzik Commentary on the Bible
 Matthew Henry’s Complete Commentary on the Bible
 James Nisbet’s Church Pulpit Commentary
 Sutcliffe’s Commentary on the Old and New Testaments