If you look at the pinout for VGA, there are several ground pins:
I was curious as to why, and I found this answer. To sum it up, the extra ground pins are so that each pin has its own ground in order to prevent interference in the analog signal.
But here's a DVI-I connector that supports analog signals:
The analog pins are on the right side. The big cross is ground, and the four smaller pins surrounding it are for the red, green, blue, and horizontal sync. What is interesting here is that the ground is shared by all three color channels, unlike VGA where each has its own.
Why are the additional ground pins necessary to prevent signal interference when using VGA but not DVI-I? They're the same pins that send the same data, just with a different physical connector, so it doesn't really make much sense as to why the number of ground connectors are different.
First: What's critical isn't so much that there's a ground pin for each signal as much as that there's a ground pin near each color signal. The cross-shaped ground pin largely satisfies that requirement.
Second: DVI doesn't prioritize high-quality analog video -- it's a Digital Video Interface, after all. The small loss of quality incurred by using a single analog ground pin was probably considered acceptable by the designers.