This is just an impression, no canon reference from Lucas himself.
The two droid serve mainly as a linking artifact between the first set of movies and the second and help the viewer relate and keep the whole plot together.
There are no major hero characters between the first set of movies and the second set and thus it is very difficult for the viewer to connect the story because of a lack of emotional connection between the movies. Obiwan dies at the start of episode iv, none of the other characters are there in the previous movies except for Vader who is a villain and arguably not someone the audience will bond with.
More so, from the story point of view no character apart from Yoda can be alive and part of the story and Yoda can't play a major part at the risk, you can't make Yoda an action hero without ruining the wise charm of the character.
That motivate the inclusion of the androids on the prequels in the first part. They are the only characters that you CAN include, plus they work pretty well (specially R2D2) in terms of merchandising and sympathy from the viewers. From a simple story telling point of view their unique reason to be is to act as a link for a story that spans longer than a lifespan.
With that in place you have to then make sacrifices. It would have been easier (from a consistency point of view) to just not have the droids, but once you include them you need to decide how you're going to solve the consistency issues without ruining the emotional connection with the audience.
Wiping both droids memories would have been logical but would have ruined that connection so Lucas had to sacrifice a little consistency. R2 had already been defined to be more secretive than C3PO and capable of maintaining a secret (i.e. The deathstar plans), it has proven loyalty on previous films and it doesn't speak the common language so it doesn't break consistency as hard as letting C3PO keep its memory.
Finally all merchandising and previous screenings show that R2 is the droid people bond to, whereas C3PO is just a comical relieve character, so, with all that taken into account, not wiping R2 memory is the logical choice.