I've never owned an HTC but that may change this year.
Having owned the M7 for a while now -- while also enjoying access to two OG Moto Xs owned by family members -- I can say what I like so much about both phones is that the phones themselves (the hardware) have receded into the background, and now there's a lot less separating me from basic daily tasks like phone calls, checking mail and weather, listening to music, etc. (Personally I prefer the M7 over the X because I'm not a fan of OLED displays and the HTC has a better camera.)
In the case of the M7, I hate to use an Apple addage but it just works. I suspect the same is true for the flagships at Samsung, LG, etc. It's literally amazing to me that I start the camera and it starts...I start Maps and GPS locks...I start music and it plays. No lag, no muss, no fuss. To me, 90% of what a phone should be is "as invisible as possible"...the other 10% of course is bragging rights and eye candy, but like beauty that's all only skin deep. What gets me through the next 18 months of ownership are the guts inside (and the OS of course!).
I have to say I politely disagree with the earlier comment about new phones needing to be a quantum leap better than existing ones (though I agree 100% that the hype associated with new releases is pretty dumb). I'm pretty sure we've reached a plateau where incremental improvements are getting smaller and smaller. Really, NOBODY cares about quad (or octo!) core systems, 64-bit architectures, 3 or 4 or 10 billion GBs of RAM...in the end, we just want it to look gorgeous and work as designed 100% of the time. And yeah, ridiculously long battery life would be nice too. Case in point: the generation of phones that came after the OG Droid were something like 5x to 10x more powerful (in terms of things like CPU cycles, number of processors, size of RAM, optimized code, etc.) and yet they often stumbled and stuttered. Just because the label says it's that much better than the previous generation doesn't mean you get an equivalent performance gain.
tl;dr Definitely think about getting the HTC M9. HTC does a good job of getting updates out, and though I had to return my M7 for a repair on the USB port, it was one of the best customer-service experiences I've had with a consumer electronic device.
-Matt