They are both great. It’s really personal preference. Some like the glock grip angle, others don’t. Some like the grip texture on the M&p, others don’t. Lots of aftermarket accessories for both.
I will say that the M&p with an apex trigger is amazing. Way better than any aftermarket in a Glock imho. If you want to change out sights, it’s easier on the glock.
I own multiples of each. Both are great. My preference tilts to the M&p though. One reason for me is I find it easier to grip and draw the M&p from the holster.