This is because when Joel tries to resist the erasing, he hides Clementine in a memory in which his mother is singing that song. Dr. Merzwiak finds the memory and erases all of it, including Joel's memory of that song.
In Eternal Sunshine of the Spotless Mind (2004), the first time Joel meets Clementine, he sings “Oh My Darling, Clementine” as a joke about her name. When he meets her after erasing her, he claims not to know that song….
This is because when Joel tries to resist the erasing, he hides Clementine in a memory in which his mother is singing that song. Dr. Merzwiak finds the memory and erases all of it, including Joel's memory of that song.