Get a Glock 17
But seriously, most of this is a preference issue. I prefer Glocks (and prefer the SIG in a DA/SA) but the M&P and M9 are both good guns.
One thing I would note is that from all the conversations I've had with military folks, the majority of them were not particularly fond of the M9. It is a 1970s design and is big and heavy for a 9MM. I've also heard a lot of complaints about breakage.
The Charlotte police department here issues the M&P 40. While some officers I shoot with would prefer a Glock, SIG, etc., I haven't heard anyone say they'd prefer an M9. The M&P is not my favorite but it is a good gun.