Board Thread:TV Show Discussion/@comment-26510044-20150618214056/@comment-5014364-20150619021117

I thought it explained this in the Legitimization article: a nobleman can't legitimize his own bastard children. Only a king can grant that -- Roose actually had to ask Tommen to grant that legitimization. The letter that he hands Ramsay has Tommen's seal on it if you look, and later in Season 5 Sansa outright points out that his legitimization was granted by Tommen.

Stannis can grant Jon legitimization because of his claim that he is the rightful heir to the throne (the Lannisters wouldn't recognize Jon's legitimization in this case - similarly, the enemies of the Lannisters don't consider Ramsay to be really legitimized).