Glock has dominated the LE market for over 30 years and how they accomplished that and overthrew giant S&W is a story that ought to be taught at Harvard Business School. In the beginning they literally gave them away, they also had a product that duplicated the functionality of the police revolver. Nobody saw them coming. At the time S&W thought Taurus was going to be the big threat as they flooded the market with lots of revolvers at a good price and their Beretta 92 clone made on original Beretta machinery left over from a Brazilian Army contract. Gaston Glock was a genius because he didn't have 150 years of firearms manufacturing tradition so he could think outside the box. Cops, however are not as innovative as one might think, and despite lip service to progress and technology, tend to stick to brands they know and trust. Glock has become the gold standard for LE sidearms and institutional purchases, a name that can be trusted just like Ford, Motorola and Monodonock. As Mike has pointed out, Glock has a great logistical network of armorers, distributors and parts are readily available. The issue becomes a known standard. Newer models are yet to be proven, the new Sigs, the new HKs, the new Walthers and the new FNs. No doubt some of these pistols will have some hiccups and require some modifications once they are issued in general quantity whereas the deficiencies of the Glock are well known and have been addressed with each Generation. In other words the Glock represents a mature technology. S&W realized the error of its ways early on but could not develop a viable competitive product. The reality is that the Sigma line was a very good knock off of the Glock, so much so that before some engineering changes were made, S&W had to pay a royalty to Glock on each Sigma sold. Even after the changes they were always regarded as "trash guns" but were remarkably durable. I saw one at S&W Academy that used by an instructor that had over 30K thru it, and he swore by it, and this is a guy who could shoot anything in the S&W line. The traditional metal DA/SA and DAO pistols, as good as they were, and for the most part, they were very good, were not as light or friendly as the Glock. Lots of people complain of the transition from DA to SA, it's never bothered me, but it is an issue with many, perceived or otherwise. This brings us to the M&P which currently is the only serious contender to the Glock, but how is it the serious contender? Well, initially by using Glock business tactics, literally giving the guns away and exchanging an M&P for a Glock or whatever on a one to one basis. S&W which is still an iconic brand and is more than just a name, it is American Legend, still evokes strong sentiment among a certain segment of the American shooter and LEO. Combine a competitive product, a household name, and an offer that is hard to refuse and you begin to see the M&P supplanting a portion of the Glock market.
As far as private sales go, civilians want what the cops carry, and 60 percent of American LE carries Glocks. In MA, Glocks might as well be made of unobtanium so they become the forbidden fruit. Like Coors Beer in decades past, or Yuengling in New England, you couldn't get it here, so it became more desirable, same deal.
In the end, what is the better gun? Damned if I know. I don't like Glocks, never have, never will, but that's a personal preference not an indictment of the gun itself. Hell, if you give me one, it's the best damn gun I ever got. I like Browning Hi Powers, 1911's S&W M39s and Third Gen S&W Pistols but those are what I used when I was developing as a wannabe shooter and quasi armchair pistolero, and probably none of 'em are as objectively as good as the Glock. I like the M&P cuz it has the backstrap options and I even have one in .45. As far as I'm concerned it is a nice gun. I'd love one in 9mm with a free state magazine, but I'll settle for the one in .45 here in MA solely because of that issue.
The fact that FNs are made in SC is a possible reason that Glocks may not be popular there. FN has produced some very nice handguns in their factory there for the last ten years or so. When I lived in GA, it was Glock country because Smyrna is the main Glock HQ in the US.
Glock has become what the S&W Model 10, The Colt SAA (which lingered on well into the DA Revolver era as a LE firearm) the 1911, and the Browning Hi Power, a standard. There might be better guns, newer guns, out there, but it is a reliable platform based on mature technology. You know what you are getting and that is why I believe they are so popular with people. Not my choice, ever, but I certainly would depend my life on one if that were my only option.