Cameras of flagships are still significantly better than a $150 Moto G. If you are using a smartphone in place of a camera and like good-quality photos, it's worth the money. That said, flagships can last many years as well.
I update pretty frequently, but all the older devices get used by family members, etc.
The camera is probably the least important thing on the phone for me, but yeah if photos are important to you then that might rule out the cheaper tiers of phones.
The camera has actually been getting worse now that they bake in AI smoothing to muddle details. I think we hit the sweet spot already going forward.