Jon pledged his life to the NW and wall, he wasn't going to give that vow up. Breaking an oath by rooting a woman or leading a force to save Arya and then heading back to the wall to resume his position is not the same as giving up the life and fight and deserting his brothers. That's what dying changed, they're not his 'brothers' anymore, they killed him, he technically and thematically doesn't belong there now.
Logic was suspended as Davos inexplicably became a campaigner for random resurrections. There are no answers on that front. With the resurrection done with his normal character was resumed last episode.
As for why he can be magically resurrected, I hold out in the belief there's more to come on that, and how.