Just want to address the point of what a sidearm is. Crappy. There, I said it, and I mean it, despite owning it. The saw you’ll see repeated (ad nauseum) is that “a pistol is only good to get a shotgun, a shotgun is only good to get a rifle.” Pistols are (relatively) lousy at everything you’d expect a firearm to do (accuracy, range, and ‘stopping power’) with the single exception of portability/concealment.
Civilians carry pistols predominantly as concealable but reasonably effective weapons. Police carry them for the portability, but if expecting actual combat, they have and use more effective weapons depending on the department (again, combat is not a main police function). Most military units do not use or issue sidearms anymore, because concealment and portability are not normally a primary need. Gangsters carry pistols for the reasons civilians do, and also as a signifier of their culture. See also this thread.
As for attitudes regarding the 9mm specifically, the arguments you’ll see are normally 9mm vs 40 S&W vs 45 ACP. In that order you get most ammunition, middling, and fewest, but reverse in terms of perceived efficacy in stopping. As mentioned upthread, with modern defensive ammunition (not traditional ball ammunition however), any of the above are effective. The issue becomes (generally) the more concealable a pistol (compact and sub-compact especially), the shorter the barrel and the lousier the accuracy. So most sub-compact semi-autos (revolvers are another kettle of fish) are 9mm by default, so you can have a small package with a respectable number of rounds.’
The 5.7 mentioned upthread is reportedly a joy to shoot with nice flat ballistics - but even at current prices for 9mm, is 3-5x as expensive to keep ammo to practice. As for efficacy, the results are mixed, as it’s very (!) high velocity but low mass leaves it open to the same complaints voiced by those who are die-hard .45 fans. Overall though it would absolutely get the job done, even if it generally doesn’t have the same access (yet) to defensive, high-expansion style rounds.
Please keep in mind though, one of the reasons is is more accurate is high velocity (less drop off from the muzzle over effective range) and that most 5.7 platforms use a longer barrel than those of defensive 9mm carry pistols. As a comparison, a default Ruger 5.7is just shy of of a 5 inch barrel. My old S&W M&P 9c (which is on the large end of the concealed weapon size) has a 3.5 inch barrel. So yeah, short barrels are not going to provide accuracy.
Last ('cause this is a book), at least one article on firearms used by criminals echoes what we’ve gone over earlier -
TL/DR: Criminals use cheap handguns, with 9mm being pretty much top, because, gasp cheap 9mm are frickin’ everywhere. So it’s cheap to buy, which also makes it more commonly available if stolen, and cheap to buy ammo for. But I don’t think criminals are buying guns after spending much time searching websites to evaluate their efficacy. 