In the last episode (S05E13) Frank explains to Claire that he was the leak to Tom Hammerschmidt because he saw that nobody was going to stop and eventually enough information would get out that he would constantly be questioned.
So, instead of leaving his fate in the hands of fate, he decided that he wanted to control the situation.
He leaked info so that it looked like Doug killed Zoe, instead of himself, and then Claire would pardon Doug anyways, so then anything that Tom Hammerschmidt had would be useless.
Even though Tom Hammerschmidt didn't have anything concrete, Claire had confessed to Tom Yates, and Frank didn't know that she had killed Tom Yates. So, as far as Frank knew, there was always doubt and always at least 1 person who knew too much.
So, again, instead of being left to the whims of whoever had the motivation to try and keep creating doubt or questions about what happened to Zoe Barnes, Frank wanted to "control the narrative" and end things on his own terms.
At the end of the episode, though, two new issues cropped-up that mess-up Frank's plans:
Claire didn't pardon Frank or Doug -- so now they're both still potentially able to go to prison.
Tom Hammerschmidt -- during his team meeting -- started to realize that everything was falling together almost "too easily", and now has doubts as to whether Doug actually did anything. He isn't fully aware of it, yet, but he's starting to realize that he (Tom H.) might be being used as a pawn.
So, similar to his resigning due to the committee constantly questioning him and undermining his legitimacy as President -- due to accusations of being corrupt and paying to win the election -- Frank knew that constant doubt and questioning (even from 1 person) about Zoe Barnes would never end. So, by working with Doug to orchestrate his "confession", and then assuming Claire would pardon Doug, Frank could then control and close-out the narrative about Zoe.
After that, anyone looking into it would have to prove a new crime or new suspect, due to "Double Jeopardy" limitations against Doug.