Both characters have “soiled” their honor for something they believe was the right thing regardless of what the honorable thing was. Ned soiled his honor when he promised Lyanna to keep Jon’s parentage a secret, thereby lying to his family and friends, and what made it even worse (for Ned’s honor) was that he said its his own bastard. Jaime soiled his honor by killing king Aerys, but later we find out that he did it to save Kings Landing, i.e. 500k people or something like that.
And what makes this similarity even better imo is that Jaime asks Brienne “By what right does the wolf judge the lion?”, because from our perspective Ned has no right to judge Jaime for his kingslaying and oathbraking, cause Ned has also done something vaguely similar.
This might be really obvious for everyone else, but I’m on my first read through on AFFC (and the entire series for that matter) and I thought that this wierd similarity is really cool.