D2 is not wrong however it would be easier to measure and open machine for the D1 dimension. Moreover, dimension D2 is to the intersection of two surfaces top and bottom. From a manufacturing point of view the dimensioning scheme amplifies the variability of the dimension tolerance and that variability would need to be understood in the tolerance assignment. Most likely the D1 dimension reflects functional requirements. BTW, this feature will require either broaching or EDM to create.
Again, D2 is not wrong just not perfered...
For a drafting, and mostly dimensioning and tolerance reference or standard see, ASME Y14.5-2009, Paragraph 1.8.17 and Figure 1-46.