There's a few problems with this.
Night's Watch
Jon had already gone off to the Night's Watch and sworn his vows. This means he legally could not claim the throne even if he knew about his birth right and wanted to. He swore an oath that he would spend his life at the wall with no titles, and it should be a death sentence to break that oath.
Bastard Inheritance
Even thought Ned knew about Jon's true father, it's likely he did not know about the marriage. This means that in Ned's eyes he is still a bastard regardless and would have very little to no claim for the throne.
Edit: With regards to Warlord099's comment, yes Ned should believe that Jon is legitimate with Lyanna telling Ned his name is "Aegon Targaryen". But! There is an issue of proof then. Even if Ned wants to claim Jon as a true Targaryen he has to prove it which leads to complications that are better left detailed here. Not to mention that even with having testimony or evidence of a marriage, it could be disputed or claimed fake. As we know, the true parentage of a character can be falsely claimed and people can believe it such as Robert's "legitimate" children.
He made a promise
When Ned took baby Jon from his sister he made a promise to protect him from being killed for his father's blood in him. This was mostly to protect him from the new King Robert. But even with Robert out of the picture declaring Jon as King because he is a Targaryen would put him in severe danger from those that don't wish to give up the throne and those that hate the Targaryens and don't want them in power.
Baratheon Line
With Robert's rebellion the line of succession has changed. Robert claimed the throne with a direct line connecting him to the Targaryen dynasty but mainly through right of conquest. This means that the original Targaryen line of succession has changed and is now following Robert's line the same as it did with Aegon after his conquest. This means that even a "known" true born son such as Aegon Targaryen VI from the books or Jon (Aegon Targaryen) Snow of the show would not have a claim without reconquering the kingdom in the name of the Targaryens.
Mix of 1 and 3
As they were both leaving Winterfell for King's Landing and Castle Black, Ned told Jon he was going to tell him the truth the next time they met. This would've been long after Jon had taken his vows and forsaken any claims he could make to the Targaryen house. We can infer that means Ned would be willing to have the truth be known but only when Jon would be safe. For even a true born Targaryen heir at the wall wasn't a threat as Maester Aemon had been there for years. If Ned was insisting on waiting for Jon to be protected by his vows then he would never have gone out of his way to put Jon in direct danger by declaring him the rightful king.