Your impressions of HTC aside, Google is clearly aiming to be a hardware and software organisation. Google has made an acqui-hire: people rather than manufacturing assets (Apple sub-contracts much of the manufacturing to third parties). By owning a hardware design company, Google can deliver a better end-to-end customer experience and a stickier eco-system. A higher uptake of the Pixel smartphone should assist Google's efforts at other hardware such as smart speakers (Google Home) and AR/VR headsets, etc.
I would also measure the success of this acqui-hire if Google is able to reduce Android fragmentation. And I would expect over time (perhaps for the 2018 Pixel smartphones) that Google's increased chops in hardware design will allow it to introduce its own chips in Pixel and other devices, esp as these future devices will rely even more on voice, visual and gesture inputs that require greater Artificial Intelligence and Machine Learning capabilities on the hardware. You may be aware that in its Google Cloud Platform, Google has recently introduced a TPU (tensor processing unit) chip with AI capability for training and learning the users needs.
Throwing a life-line to HTC should also benefit the Android ecosystem in general so that Android does not end up being totally identified with Samsung. Unlike the Motorola acquisition in 2011 and the subsequent hands-off approach taken by Google, this time Google is going to be a strong competitor within the Android ecosystem. This time, Google's approach towards Samsung appears to be: if you don't like it, try selling your phones using your Tizen operating system.