Because the test course is a fixed length and profile, and they're comparing the number of gallons consumed between vehicles to complete the standardised course.

M/g with fixed M and varying g means that the denominator is changing.

It would be difficult to test the cars on a fair yet realistic basis if you had to drive along some kind of (varying) course until you have consumed exactly one gallon and then measure the distance you have travelled.

Volume / distance is a better metric anyway because it's easier to correctly compare the performance of two vehicles. Your fuel savings suffer from diminishing returns from increasing MPG. An improvement from 10 MPG to 20 MPG (halving your fuel consumption) is much, much, much bigger than an improvement from 40 MPG to 50 MPG (cutting your fuel consumption by only 20%). But an improvement of 1 GPM, or 1 L/100 km, is always going to yield the same amount of savings no matter what your baseline is.

This is particularly relevant when you consider that for most use cases, the amount of travel a particular person needs to do is a fixed variable and the type of vehicle they drive (and hence fuel efficiency) is the independent variable. People choose a car based on their needs; they don't select their commuting route based on the kind of car they drive.