We can pretty much assume that memory wipes are fairly common in the 24th century, since the same thing was done to Voyager's EMH at one point. Sort of their version of electroshock therapy.
Of course the best answer to the question would be something like "What memory wipe?"
Well the Doctor being a computer program can be explained away... sorta, if you don't believe he's sentient. Another disturbing thing in that episode is that Ensign who the EMH let die. Just imagine her funeral... "Though you may be gone Ensign so and so, you will never be dead so long as you remain in our memory.... the funeral is over, Tuvok... purge all computer records of her existence."