Honestly? I think their popularity comes down primarily to price point and brand loyalty. Glock really got their foothold in the U.S. market due to their popularity with police agencies. While Glock pistols are probably the most common gun to see on a police officer's hip, this wasn't always the case. Prior to Glock's popularity, there was a bit for variety in Cops' holsters but the most common were probably various metal-frame, hammer-fired DA/SA "wonder nines" like Beretta 92 variants, Sig 220 series, and S&W 2nd and 3rd Generation semi-autos which, by the mid-90's, had largely supplanted revolvers as the go-to Cop's gun. Glock was able to replace many of these because they could sell their guns at a significantly lower price point than a more traditional metal-frame, hammer-fired gun. A small-town Sheriff's Deputy that I knew back then was able to purchase a brand-new Glock 21 for $300, cheap enough that he was able to sell the Colt Commander he'd been carrying for the previous 10 years for substantially more. While there were some early attempts by other makers to get into the polymer frame market, and thus Glocks price point, like the Ruger P95 or S&W Sigma series, they were never as well received as the Glocks. As is often the case with firearms, those used by the military or police often become popular with the rest of the market and such was the case with Glock.
Fast forward a few years to the late 2000's and 2010's and there are a lot of good, well-regarded polymer-frame striker guns out there like the Springfield XD Series, S&W M&P Series, and Sig 320 series. From a reliability, capacity, and accuracy standpoint, there really isn't much Glock can offer that isn't available from any number of other makers. However, Glock was the first and is the most well-known within that market so they remain popular. Also, due in large part to institutional momentum, they remain popular with police because, while they may not offer any great advantage over other guns of the type, they offer no significant disadvantage either. One advantage that Glock does offer, though it diminishes the longer time goes on, is that because of their longstanding popularity there is a wide variety of magazines, holsters, sights, and other parts and accessories available for typically reasonable prices (though some of their competitors are catching up in this regard).
Unfortunately, Glock seems to be one of those guns that attracts "fanboys" for lack of a better term. These people seem to make it their life's mission to convince everyone who will listen (and some who won't) that a Glock is the greatest gun ever devised and that Gaston Glock was inspired by the almighty. These people seem to be emotionally invested in their belief that a Glock is the be-all end-all of pistols and take offense when anyone criticizes one or prefers something else. Frankly, I think that a lot of the acrimony towards Glock pistols stems from how irritating the "fanboys" can sometimes be.
If you've never tried a Glock pistol, it might be worth shooting one to see if it appeals to you as they are accurate, reliable, high-quality handguns. If, however, you find that they don't appeal to you or something else is a better fit for you wants/needs, that's perfectly fine too and you aren't necessarily choosing an inferior pistol if you go with something other than a Glock. Personally, I've shot a few Glocks and they were OK, but I find other pistols which fit my hands better and have features that I prefer which aren't available from Glock. I have no issue with someone who likes Glock so long as they aren't obnoxious about it and/or critical of me for choosing something else.