Comfort, comfort My people, says your G-d.” (Yeshaya 40:1) Chazal comment in the Midrash (Eicha Rabbah 1:57): They doubly sinned, as it says, “Yerushalayim sinned a sin;” they were doubly punished, as it says, “for she has received from the hands of Hashem double for all her sins;” and they will be doubly comforted, as it says, “Comfort, comfort My people.”
What is the meaning of “doubly comforted” – is one comfort from Hashem not enough to console? What does a second comfort add?
Rav Zevin writes that they were “doubly punished,” because it says, “כי לקחה מיד ה’ she has received(punishment] from the hands of Hashem.” The name Hashem represents the attribute of mercy and in this passuk, describing how Hashem has punished us, it has turned into an attribute of justice. This is a double punishment. Not only did Hashem not have mercy on us, but even the attribute of mercy turned into the attribute of justice. However, they are destined to be doubly comforted, as it says, “Comfort, comfort My people says your Elokim.” Elokim represents the attributes of justice. When the attribute of justice will turn to the attribute of mercy – this is truly a double comfort.
When we sin, we sin doubly, once for not doing the will of Hashem and two for not allowing Him to do good to us. It hurts Him when He cannot do good to us and maybe there is a double nechama, one for us and one for Himself.
This happens when the midas horachamiim turns into midas hadin as above, so Moshe Rabbenu was asking in Parashas Vaeschanan to turn midas hadin to midas horachamim.