In Game of Thrones season 5 episode 9 titled "The Dance of Dragons" Jon and company arrive at Castle Black after a disastrous battle against the White Walkers at Hardhome. They leave the battle at Hardhome on boats. So they most likely stopped off at Eastwatch by the Sea and marched towards Castle Black. Here is a map of Westeros for reference:
Theoretically when they arrived at Eastwatch it would make more sense for them to travel to Castle Black on the southern side of the Wall. But in the show we see Jon and company arrive back at Castle Black but they are on the northern side of the Wall. Why did they do this? It doesn't make a lick of sense. The White Walkers and the wights are all north of the Wall. They faced potentially more attacks by traveling on the north side of the Wall. Eastwatch and Castle Black are around a 100 miles apart so it would've taken several days to make that journey. That would've left them in danger by being on the north side of the Wall and they could've gotten attacked again by the White Walkers and the wights.
It just doesn't make logical sense to me. It feels like the writers only did this to falsely create dramatic tension when Ser Allister Thorne hesitates on whether or not to let Jon and company through the main gate back into Castle Black.
Is this just bad writing by the TV show writers? Or am I missing something? Cause for Jon to lead his people along the north side of the wall just makes him seem dumb.