Jon's parentage is not relevant regarding who he is the son of, but rather, who he is not the son of.
He's roughly the same age as Robb Stark. I did a little online sleuthing and cannot find a definitive answer as to who is older. Catelyn hates Jon because he represents her husband's alleged infidelity, but he also would be a threat to trueborn Robb's claim to Ned's inheritance were he to be legitimized. When Robb dies in combat, Jon needs to be out of the way by way of his vows instead of just waiting.
Since Jon is a bastard and cannot inherit Winterfell, he is sent to Castle Black to give book audiences a POV character at the Wall to witness The Others/White Walkers.
The fact that he is Targaryen is a dangling carrot for the audience to hope that he will someday take the Iron Throne, but he is more important as a bitter pill for his Queen. She loves him but she loves her ambition more, and cannot accept him as a rival with all the political baggage it carries. If Mad Queen Dany had been given more time to steep, this would have been more obvious.