Price. Simple as that. And the strategy of giving special deals to police departments making bulk purchases. Town governments are not going to let police departments spend taxpayer bucks on anything that's a penny more expensive than it absolutely has to be, so they buy the cheapest thing that seems fairly decent. This has the effect of creating the false impression among civilians that Glocks must be the best gun available - or else cops wouldn't want them, right?
A similar thing happened in CAD software years ago. AutoDesk was almost giving away their software for free to all the schools, creating the false impression among students that "industry must consider this the best CAD system software or it wouldn't be so widely used in schools" - but there was never any truth to it. Once you are out of school, you find that industry would rather use almost anything but crappy AutoCAD. I almost never get AutoCAD files from anyone because nobody uses it for serious mechanical engineering, but an entire generation was incorrectly taught in school that it was widely considered the best. Aside from in architecture, which is about the simplest possible use of CAD, it's actually considered to be the worst by almost everyone who's ever used anything else.
Public opinion gets steered in stupid directions for stupid reasons all the time.
I like Sig's and HK's and would dump my G20 in a second if either of them made a 10MM because I'm willing to pay more for a better gun.