text: The question is, why would Krishna, the supreme Brahman, tell the Pandavas to lie
  
  Krishna asked Yudhishthira to speak untruth because under such circumstances, falsehood is better than truth and is explained in the passage at the end of this answer. Note that, in this context, he asked only Yudhishthira to speak untruth not asked to all Pandavas.
  
  and then punish them for it!?
  
  Yudhishthira got punishment of watching illusion of hell because of the reason that he didn't follow the instruction of Krishna due to the fear of untruth. Yudhishthira distinctly said that Aswatthaman was dead, adding indistinctly the word elephant (after the name). Krishna didn't ask to say the word elephant, but Yudhishthira told. This is the reason for punishment to Yudhishthira's act of deception towards Krishna. Note that Yudhishthira got such punishment of watching illusion of hell due to the act of deception, not for speaking untruth.
  
  The following passage will explain in detail, the deception by Yudhishthira.
  
  
    "Meanwhile, O monarch, Govinda, knowing that Drona, that foremost of
    warriors, was capable of sweeping all the Pandavas off the face of the
    earth, became much distressed. Addressing Yudhishthira he said, 'If
    Drona fighteth, filled with rage, for even half-a-day, I tell thee
    truly, thy army will then be annihilated. Save us, then, from Drona.
    under such circumstances, falsehood is better than truth. By telling
    an untruth for saving a life, one is not touched by sin. There is no
    sin in untruth spoken unto women, or in marriages, or for saving king,
    or for rescuing a Brahmana.' While Govinda and Yudhishthira were
    thus talking with each other, Bhimasena (addressing the king) said,
    'As soon, O monarch, as I heard of the means by which the high-souled
    Drona might be slain, putting forth my prowess in battle, I
    immediately slew a mighty elephant, like unto the elephant of Sakra
    himself, belonging to Indravarman, the chief of the Malavas, who was
    standing within thy army. I then went to Drona and told him,
    'Aswatthaman has been slain, O Brahmana! Cease, then, to fight.
    Verily, O bull among men, the preceptor did not believe in the truth
    of words. Desirous of victory as thou art, accept the advice of
    Govinda. Tell Drona, O King, that the son of Saradwat's daughter is no
    more. Told by thee, that bull among Brahmanas will never fight. Thou,
    O ruler of men, art reputed to be truthful in the three worlds.'
    Hearing those words of Bhima and induced by the counsels of Krishna, and owing also to the inevitability of destiny, O monarch,
    Yudhishthira made up his mind to say what he desired. Fearing to utter
    an untruth, but earnestly desirous of victory, Yudhishthira distinctly
    said that Aswatthaman was dead, adding indistinctly the word elephant
    (after the name), Before this, Yudhishthira's car had stayed at a
    height of four fingers' breadth from the surface of the earth; after,
    however, he had said that untruth, his (vehicle and) animals touched
    the earth. Hearing those words from Yudhishthira, the mighty
    car-warrior Drona, afflicted with grief, for the (supposed) death of
    his son, yielded to the influence of despair. By the words, again, of
    the Rishis, he regarded himself a great offender against the
    high-souled Pandavas. Hearing now about the death of his son, he
    became perfectly cheerless and filled with anxiety; upon beholding
    Dhrishtadyumna, O king, that chastiser of foes could not fight as
    before.'"