Yet it pleased the LORD to bruise him; he hath put him to grief: when thou shalt make his soul an offering for sin, he shall see his seed, he shall prolong his days, and the pleasure of the LORD shall prosper in his hand.
Even though it made God sad to punish him, He did it because it was part of His plan. When this person's life is used to forgive others' mistakes, God will bless him with many good things, including a long life and happy children. And everything will go well for him as God intended.