His journey was never about finding happiness for himself, but to save the world. That was the story of Samurai Jack. He has his whole life to figure out if being Emperor Jack will work out.
He came to terms with her dying because he realized that even though he's sad right now, he prevented the terrible world that caused her to be, so that if she does happen to come about, she'll have a chance at a happy life, everyone from aku's bad future will.