To be clear, Apple still messed up, because they didn't communicate this at all. They could have also put in a slightly larger battery to begin with.
But in the tech world, Apple isn't the worst in pushing people to upgrade hardware, which is illustrated by the fact that people use iPhones longer before upgrading than Android users. That's the one upside of Apples crazy App Store margins... they really don't need to push new hardware on you to make a shitload of money (while for Android that money goes to Google rather than hardware manufacturers)
Apple could do better - WAY better - but I think it's a bit naive to think that this could possibly change, and is worth complaining about. The only way it would, if there was somehow significant money in spending lots of time optimizing OS updates for old devices. But most people like upgrading their phones anyway. For Apple to change, consumers must change first. I don't think there's much hope for government regulation here either. It's a problem that's too complex to regulate.