Jon Snow is a man of honor.
It's part of his core personality.
His own personal care is less important for him than being honorable and doing the right thing for the people.
Running away after killing someone (no matter who or what the reasons are) is a very cowardly act, so it's against his very nature.
Also keep in mind he didn't try to run away from the dragon, but instead faced it and was fully prepared to be burned alive as a consequence of his actions.
Another point is the "right thing for the people" part.
Suppose he would have fled and the people found out about what happened when he's away.
The Unsullied would surely act against the people, and likely many people would die until peace is somehow restored.
movies.stackexchange.com/users/106/Shadow Wizard is Ear For You
Because he is a man of honesty and it has been shown in his own words before (from season 7 finale):
"I'm not going to swear an oath I can't uphold.
When enough people make false promises, words stop meaning anything.
Then there are no more answers, only better and better lies.
"
And if you go by his arc he can lie and cheat easily to get away many times before but
he will not he is an honest man.
movies.stackexchange.com/users/1190/Ankit Sharma
In addition to the other answers, we should remember that Jon was not just in a relationship with Daenerys but was in love with her.
He killed her despite his love for her, because of its importance to everyone's lives; but it was still absolutely heartbreaking for him not only to lose her but to be the cause of that loss.
I would imagine someone in that situation to feel absolutely desolate, to the point of not caring what happens to him next—perhaps even with the feeling that he deserves to and/or wants to die.
movies.stackexchange.com/users/74338/Greg Martin
In addition to this being precisely in-character for Jon, there is precedent for Daenerys leaving with Drogon.
She did exactly that after the Sons of the Harpy attacked her in the fight pits of Meereen.
And what happened after is that everyone continued what they were doing until Dany returned.
Her regime was upheld, awaiting her return.
The same would have happened in this case.
So even if Jon had gotten away with it without being imprisoned; he would not have actually stopped the atrocities that were going on.
movies.stackexchange.com/users/22424/Flater
In addition to the other answers which I think are the primary reason (honour), consider that lying probably would have raised more questions anyway.
It would be very odd of her to simply fly away without saying anything, and in time the suspicion would only grow.
movies.stackexchange.com/users/65627/user
Why did Jon admit that he killed Daenerys in  Game of Thrones  S08E06? Why didn't he just tell that she flew away with her dragon? He could say that, escape from the Unsullied and then tell the truth. I understand that there was blood and a melted throne, but he could come up with something.
Why did Jon Snow admit his fault in S08E06?
movies.stackexchange.com
<plot-explanation><game-of-thrones>
movies.stackexchange.com/questions/101035
movies.stackexchange.com/users/74308/Mitch
Jon Snow admitted to killing Daenerys at the end og GOT because of his honor. He was less bothered about his own safety than doing the right thing for the people. He killed her despite being in love with her. Moreover, it is unlikely that people would have believed she had just flown away. The act of escaping after committing a murder is cowardly, so it goes against his character.
His own personal care is less important for him than being honorable and doing the right thing for the people. Running away after killing someone is a very cowardly act, so it's against his very nature. This is completely in character for Daenerys as well. Even if he had escaped being punished, he could not have stopped the violence. Lying was one of the other answers in addition to those that I thought was going to be raised. It would be extremely odd if she escaped and no one noticed.