The answer to this question should be fairly obvious to anyone who has watched all the movies.
Star Wars (later re-titled A New Hope, Episode 4) was the first movie released. At that time they couldn't have any idea that this movie would be the blockbuster that it was spawning so many sequels and prequels. Point being it was episode 4! When it came time to make the prequels, the writers had to reverse engineer some plot points in order to explain why the characters behaved a certain way in what is actually a later timeline.
In episode 4, (the original Star Wars movie), when Luke accidentally plays back a portion of the video file of Princess Leia, C-3PO is truly clueless as to who this person is an only knows that she was "a person of some importance" on the ship in which they served on. I think it could also be speculated that C-3PO would be a terrible liar and would not be able to play off his naïveté so genuinely.
R2-D2 is clearly lying through his teeth (figuratively of course), he very well knows the identity of the Princess, has been given a secret mission and tries to hide any information about her from Luke. So it was absolutely imperative when episode 3 finally does get made so many years later that this somehow gets addressed. Wiping C-3PO's memory or at least a portion of it and leaving R2-D2 and his memory intact fills this plot hole quite reasonably.