I like many many things about Android. But they really need to sort this out, at least for their flagship phones.
EDIT: I have three and four year old computers that are running Windows 10 Technical Preview just fine. And it's not like new low-end Android phones are more powerful than four-year-old mid- and high-end phones. I think that it's silly that we have reset our expectations so low that it's beyond the pale that companies should support OS updates on four-year-old phones.
1) Increase in available computing resources;
2) Commoditization of the platform.
It can be argued that we are just reaching condition (1), but we are still a bit far from (2). The peculiarities between hardware platforms make it necessary to actually test on each hardware platform. As the installed base of a phone dwindles, after a point it makes little sense to provide updates.
We'll get there, but it'll take a few more years. In the meantime, Nexus are great choices, because the developer community can actually fill in for the necessary testing and tweaking. I had an HTC Desire before my Nexus 5, and it was incredible how much its life was extended by a vibrant community (mine lasted over four years and was clearly outdated spec-wise when I bough the N5).
(I know, I know... should have bought a Nexus, should have bought an iPhone. My mistake for buying Motorola. Won't happen again.)
18 months is a joke
If a company will not support a device and has locked it down there should be a moral obligation to allow others to support it.
Hardware should not be dead-ended.
I stopped upgrading because of this.
Security and OS updates should be separate