Dimmesdale agrees to leave with Hester but only because he feels he is "doomed,—wherefore should I not snatch the solace allowed to the condemned culprit before his execution."
“Thou wilt go!” said Hester calmly, as he met her glance.
However, "The decision once made, a glow of strange enjoyment threw its flickering brightness over the trouble of his breast. It was the exhilarating effect—upon a prisoner just escaped from the dungeon of his own heart—of breathing the wild, free atmosphere of an unredeemed, unchristianised, lawless region. His spirit rose, as it were, with a bound, and attained a nearer prospect of the sky, than throughout all the misery which had kept him grovelling on the earth. Of a deeply religious temperament, there was inevitably a tinge of the devotional in his mood.
“Do I feel joy again?” cried he, wondering at himself. “Methought the germ of it was dead in me! O Hester, thou art my better angel! I seem to have flung myself—sick, sin-stained, and sorrow-blackened—down upon these forest-leaves, and to have risen up all made anew, and with new powers to glorify Him that hath been merciful! This is already the better life! Why did we not find it sooner?”
Thus he is extremely happy to have decided to go back to England with Hester. These paragraphs are found in the enotes etext of "The Scarlet Letter, pgs. 98-99.