So, speaking from a technical, literary standpoint…like Chekhovs Gun or formulaic character arcs or basic foreshadowing, most well crafted narratives have everything happen for a reason. You show someone afraid of spiders in the beginning to show how timid and cowardly they are, so their arc at the end where they overcome their fears is more potent. You have your character break into a car early on to establish he has lockpicking skills so it doesn’t come out of nowhere in the climax.
Everything should have a purpose, whether it be to establish a character arc, or to set the ground rules of the world and story. So, pray tell, what would the undercover Wildling Jon plotline and Ygritte’s purpose to the overall story be?
1. Just to put Jon through even more hurt and pain, because GRRM likes seeing his characters suffer?
2. To teach Jon about the Wildling culture beyond the wall, even though it’s mostly likely to be destroyed the others pretty soon?
3. An excuse for GRRM to write more sex?
4. The best way to get the White Walkers and Night King into the Nights Watch’s attention?
5. To set a precedent of Jon going “undercover” to honor his duty over love?
When ASOIAF is all over and done, and the ending is glaring you in the face, whatever that ending may be - dead Dany, alive Dany, dead Jon, alive Jon - you could probably look back at Ygritte and the Wildling storyline and think “what was all that about? Was that a waste of time? What was the point?”
In regards to option 1: as much as GRRM has gotten a reputation for liking to kill his characters and create dramatic sequences, he always does so for a narrative purpose. It never seems to be haphazard or just because he wants to cause suffering. Giving Jon a love interest just to kill her for the sake of drama doesn’t seem to be his goal. A lot of writers, especially film writers, seem to do this, but I don’t buy it from GRRM.
In regards to option 2: by the end of the series, the Wildlings will probably be gone or at least severely crippled in numbers. I doubt there’s any important Free Folk culture bit that will come in incredibly handy with killing the Night King. And if the Wildlings will be dead, then it would be a waste of writing attention and page numbers to dedicate simply to just learning more about them.
In regards to option 3: kind of goes with option 1, the love interest line of thinking. If GRRM just wanted Jon to lose his virginity, it sure is a long and windy way to go about it - to have him go beyond the wall, kill a brother, pretend to be a turncloak, resist Ygritte at every turn, somewhat reluctantly give in and break his vows and then have her die. Good romance novel plot, but asoiaf?
In regards to option 4: to bring the true threat of the White Walkers into the story. Once again, there could have been quicker and easier ways to do it. Jon didn’t need to go undercover to do it, they could have found out while on the range independently of Jon having to go undercover. If GRRMs ultimate goal was “we need him to find out about the WW on the other side of the wall” it’s a big leap to go to “let’s have him pretend to turncloak and fall in love and fuck a Wildling to do it.”
Now, option 5: to set precedent. If there’s a big reveal later on that Jon is deceiving Dany - going “undercover” to survive while honoring his duty - it won’t come as big as a shock because it’s already happened before. Readers won’t find themselves closing the book going “whoa. Is Jon the bad guy? How could he do that? That came out of nowhere.” GRRM has already established Jon’s lines in the sand (or lack thereof), his morals, and what he’s willing and able to do - despite love, despite vows, despite fear. Ygritte will be the example he calls back to.
Despite it being very captivating, good storytelling, and beloved parts of the books, could you imagine just chopping the undercover Wildling plot out of the narrative, and anything being affected? Would anything change if he had not gone undercover? So unless Ygritte and the undercover Wildling plotline was a shaggy dog, or an example of gardening getting the best of GRRM, it has to have been done for a reason.