All government contracts are won by the lowest acceptable bid. There is no other credible answer.
As someone who works in government and has served on numerous selection committee's (for large software projects, not sidearm selection, but the process is similar regardless of the item), I can honestly say that this is not true. Typically, we put out an RFP (Request for Proposals). Various bidders then respond back with their proposals. We'll then bring them in, do interviews, look at samples of their work or previous projects, etc. Bid price is a factor in the selection criteria, but it is NOT the sole determining factor. As an example, when we were selecting a permitting/planning/zoning software implementation, we had 6 companies bid on the job. All had done such implementations before, and we probably could have made due with any of them, but we ended up going with the 2nd most expensive one, simply because their offering looked to be of higher quality.
This isn't really pro or anti-Glock. Personally I like them, but I tend to favor Ruger over any other brand. I'm just saying that the whole "the government always goes with the lowest bidder" mantra is mostly just a myth.
That said, while there are any number of factors, being from the computer side of things in my professional life, there used to be an old addage: "Nobody ever got fired for buying IBM.". Eventually that often got changed to "Nobody ever got fired for buying Intel.", or sometimes Microsoft. The basic thought though is that by buying the current "favorite" item, you deflect any possible blame if something goes wrong with them. If you buy Glocks and they mess up, then it's not your fault: everyone uses them - any sane person would take their recommendation. On the flip side if you bought say, CZ's, and they mess up, then there will be an immediate accusation: "Everyone else is buying Glocks - why didn't you?".
Not saying that Glocks, or CZ's, or whatever is bad. Indeed I think that for MOST of our law enforcement needs between Glock, Ruger, S&W, CZ, Beretta, FN, Steyr, SIG, etc - it's probably a wash. MOST of the big manufacturer's these days put out reliable products that would serve an officer just fine. I'm just saying that when purchasing a lot of guns, there is safety in going with the "obvious" choice.