First of all, codes can NOT be made retro-active. If the old two-prong recep is legal, it is legal to replace it with another two-prong receptacle.

What is not legal is to remove a legitimately grounded three-prong receptacle, and replace it with a two-prong.

There is a little room for debate as to what is a "legitimate" ground. There was a time when you could run a wire outside the conduit, to a water pipe, to make a ground.

NEC says you can side-step the grounding requirement (for three-prong receps) by having ground-fault protection.

Now, suppose you find a home where the two-prong receps were simply replaced with three-prong types. Since the three-prong ones were never correct, I maintain that you are allowed to return things to the way that they were- and put the two-prong ones back!

It seems evident to me that the code panel, in a fit of sanity, recognises that no on is going to rip open all their walls and re-wire their homes- so the GFI provides an alternative.