I think it comes down to personal choice. I believe that the S5 is the best considering the after sales support and ADH.
I've been over the specs of them all time and time again, so I think this explains it in terms of what's best for what:
Build Quality: HTC One > Z2 > S5 (HTC is 90% aluminium, Z2 has an aluminium frame, S5 is plastic)
Camera: Z2 > S5 > HTC One (the HTC may be better at low light. While the HTC is only 4 megapixels, the pics it takes are stunning. I for one would prefer higher megapixels though).
Chipset / CPU / RAM: S5 and Z2 > HTC One (S5 has the higher clockspeed, Z2 has 1 Gig more RAM, HTC has the same clockspeed of the Z2 but only 2 Gigs of RAM, like the S5). I honestly believe the differences here are almost negligable.
Availability: S5 > Z2 > HTC One
After Sales Service: S5 > Z2 (I'm assuming here) > HTC One
Each phone has unique features. Like the S5 and the fingerprint reader / heartrate monitor, the Z2 and the dedicated camera button and the HTC One with awesome speakers and having the choice to buy the overpriced dot matrix cover.
I for one, will be getting an HTC One. It's just a beautiful phone. And that's what I want - a beautiful phone.