Beyond the “taking one last look” moment the film treats 3PO’s memory wipe as a joke, probably because it’s not permanent and so it’s not meant to be taken too seriously. But if he didn’t get his memory back it would feel even more jarring/disrespectful how the other characters don’t seem to care much about it and how the film constantly makes a joke out of it.
He’s had his memory permanently wiped before, and that was treated as a joke too.