As a former police firearms trainer and armorer, maybe I can comment on some aspects of the .40 which make it less attractive than it was when introduced in 1990. There is really nothing wrong with it except:
1. Police and FBI recruits are easier to get qualified with a 9mm versus the .40. Two-thirds of American cops carry Glocks, and the .40 Glocks are much more challenging to shoot well for new people than are the same guns in 9mm. 9mm ammunition has improved so much in the last decade that there is very little reason to opt for the .40 for recruits anymore. The .40 does have a "snappy" character to its recoil that some new shooters find disconcerting. It can be mastered, but requires a bit more commitment than most recruits have anymore. How the .40 feels in hand can be changed simply by buying a different type of ammunition. In my experience, the 180 grainers feel the mildest (but with more flip), the 165 grainers are in the middle, and the 155 grain loads are nasty numbers that you feel in your teeth when you fire them, but move out of the gun very fast. Your choice.
2. People say that the .40 is harder on guns, accelerating wear and parts breakage. Having maintained .40 issued weapons, this is partially true. However, that seems to be more of a function of whether or not the gun started life as a .40 by design, or was modified from 9mm. The .40, in my experience, is especially hard on Glocks of older vintage. I do not note this accelerated wear or breakage on M&P's.
3. Many whine about the additional expense of shooting the .40 versus the 9mm. While this may be true for some, if I compare ammunition of equivalent quality, brand for brand, I find that I am paying $1-2 more per box for .40. This will not make or break me. I have also located a source for LE contract overrun .40 caliber ammo which is top quality and is running me less per case than most 9mm.
4. I had sworn off the .40 until recently, saying that I just didn't "need one", owning many 9mm and .45 acp guns. But then I was offered a brand new M&P Compact with 3 magazines and night sights at a price that I could just not turn down, getting me back into the caliber. I'm having a great deal of fun with it, carry it regularly, have an additional barrel (because I still like to play with .357 SIG) and like it so well that I bought a 9mm version of the same gun for my new students to shoot.
So my bottom line is, if you want a .40, buy one and take advantage of the cheaper pricing available these days. Having been the top caliber in American law enforcement for over 20 years, I think there is zero chance it will go away in our lifetimes.