High end smartphones are overpriced but many people use them so much that the hourly cost isn't too bad if you break it down. If you're using a device 3, 4, 5, hell, 8 hours a day, why not have one that's 20 percent better than that 400 quid mid ranger?
And as someone pointed out, people waste money on lots of things they don't need and with some things (eg cars) the returns from getting a new pcp car every 2 years are likely to bring changes but few worthwhile improvements.
So yes, flagships overpriced (the s20 Ultra is a joke) but they're obviously selling enough otherwise the price would come down.