Google Pixel 2 is good but for some reason they calculated it's more optimal to put all the effort and resources into a back camera and not have a front one at all or something with newer models of it.
When it comes to software etc I believe it's the only smartphone (other than perhaps other Google subsets like the Nexus series) that gives you the google play store for free which is extremely important if you actually understand how viruses evolve. Google Play store ensures that unless Google itself got hacked or wanted to release viruses on the world, you are never ever even by a misclick going to get a virus on your Android (which means the main selling point of iPhone, that you can't get a virus on it, is mitigated entirely).
The cash though, I admit is steep. When I got Google Pixel it was a major present to last me years and so far it's lasted me I think 3 years exactly in December (yes it was a Christmas present).
Pixel 2 is almost entirely waterproof (obviously if you put it in high pressure depths of the ocean it will break, don't be an idiot) but honestly I think it's next-level in terms of having a phone that is entirely secure from any company other than Google. There is literally no other Android-making company that enables you to expose yourself to only Google (Android itself is partnered with Google so Android isn't an additional exposure).
I won't type more as I can be accused of advertising but seriously it's the best-out in terms of actual value but if you want 'value to the dollar spent' I admit it milks the success of the original Pixel and easily is overcharging by a significant percentage of what you pay. I would note that a lot of what you pay is stuff you don't realise (god-tier Siri competitor, the Gogle voice assistant and Google Play Store free permanent access etc)