From Star Trek TNG: Technical Manual (bold by me):
The Galaxy-class Enterprise maintains Starfleet's tradition of honoring the original starship Enterprise. Like her predecessors, this ship bears the original Starfleet registry number of that illustrious first Enterprise, NCC-1701. In this case, the suffix "-D" indicates this is the fourth successor to the name and number. Few other ships in the Starfleet have been so recognized. So significant were the exploits of this original ship and its crew, that in 2277 the practice of having a separate insignia for each starship was abolished, and the Enterprise emblem was adopted as the official symbol for the entire Starfleet.
The practice to reuse registry numbers by adding a letter suffix to them was not a common practice, and is seems evident that having multiple reuses leading to letters "-D" or "-E" was exceptionally rare.
As reported, the reason for this practice was to honor a single starship that achieved exceptional results and whose importance in the history of the Federation was further recognized by adopting its insignia as the emblem of all Starfleet.
Like the first Enterprise, even her successor ships exploits were blessed with great achievements, further reinforcing the almost legendary status of ships sharing this name, making it so that "-D" Enterprise was bestowed the honorary title of flagship (but possibly other Enterprises as well).
In the end, it seems that with the Enterprise, standard specifications were loosened and tradition and prestige were the dominant factors in adopting what was an exceptional practice.
All in all, a registry should be unique and recognizable and unambiguously identify a given starship; for this purpose, if we take in example NCC-1701 and NCC-1701-D, they are two distinct and recognizable registries and uniquely identify a single starship, even if they share the numerical part.