When you have many profitable businesses you don’t need to make money on every single one of them.
Pixel is a showcase device and mostly targeted to convert iOS users to android users. This is a win for google, not to get marketshare from existing android users that already use their services.
Other than that, I think 7 and 8 series sales hold 50% of the whole pixel sales so they finally got some traction in the market.