Personally it depends on what you plan to do with the phone. Watch a lot of videos and listen to a lot of music? Htc one hands down. If you enjoy a smaller form factor with a near stock android experience plus great features you can't find on any other device, then the moto x it is. If you are a spec geek that loves stock android, then the nexus 5 is for you.
I speak from experience as I own all three of those devices I listed.
Originally purchased the HTC one when it was released , and love the device. Nothing compares to the dual stereo front facing speakers. That combined with a super pixel dense display and you have the best media consumption device, hands down. 468ppi on 4.7inches lcd3. It spoils you. Htc sense is also super intuitive and I enjoy what it has to offer. The build quality of the HTC one is also amazing. The all aluminum unibody design fits great in the hand, and feels cool to the touch when it has been sitting. I have used both stock android and sense ROMs on it, and both are great. As far as the camera goes, its a fantastic all around camera. Sure it may not have the highest resolution however its micron size is 2.0 allowing for significantly more light to be absorbed, resulting in fantastic low light capabilities. Also this device Is significantly larger than other 4.7inch display devices such as the moto x due to its dual front facing speakers dubbed boomsound.
As far as the moto x goes, I was originally skeptical due to the specs. However after using one for a few months I have to say it offers the best android experience, IMO. Its near stock android feel wins me over, and the unique features it Has to offer are very useful and spoil you. Once you get used to active display / notifications you will never go back! The level of software optimization going on is also outstanding. This device is amazingly smooth and efficient. Due to its added natural language processing and contextual computing cores , it can dedicate certain tasks to those cores which in turn takes some of the load off the CPU. I have to say the moto x runs chrome (a program notorious for hogging resources) faster and smoother than most quad core devices I have used. Its nearly non existent side bezels make for a great form factor.
Now last but not least the Nexus 5. Obviously I have spent more time with the HTC one and moto x as the n5 is newer, however I have been using it since released and have to say I have been really enjoying it. I enjoy the subtle understated design, and the specs are top notch. Combine all of that with quick updates and you have the best 349$ unlocked phone out there. If off contract is key, the nexus 5 rocks. Keep in mind the moto x is on sale for 350 on Monday.
Food for thought. Hope it helped.
Sent from my Nexus 5 using Tapatalk