Google has played around with a lot of hardware and software that they ended up abandoning after they got bored.
OK, but how many times have they abandoned phones or tablets? Sure they've done that with niche products like Glass or the Nexus Player, but their phones and tablets have always gotten the full 2 years, barring issues with hardware partners. For example, TI dropping out of mobile and leaving the Galaxy Nexus abandoned, even though it most likely wouldn't have gotten KK anyway since it was right on the 2 year mark. But with no updated firmware or drivers, how good would the experience have been? Would lower battery life and performance be worth it just to say you're on the newer version?
Now there have been rumors that Google is looking to follow in Samsung's and Apple's footsteps and engineer their own SOCs, which would eliminate reliance on chip vendors for support. But until that happens, there's nothing much Google can do about it. In fact the only instance I can recall of a Nexus device (or Android device for that matter) officially getting version updates past the 2 year mark is the N7 2013, which IIRC went 2.25-2.5 years after it's launch. I don't know if there was a reason Qualcomm supported the S4Pro for longer, but regardless, that's what most always happened. If anyone should be able to go for longer, it would be Samsung with their Exynos chips. They're designed and built in house, and Samsung is big enough to support them. They really have no excuse for not supporting them for longer, and it might be a draw for customers to their products with the Exynos chips inside. But support doesn't net them any revenue as new device sales do. So business wise it makes more sense to continue their planned obsolescence.
And as others have pointed out, with Google removing most key apps from the OS and updating them independently in the Playstore, they're still quite usable after version updates have ended. Whereas Apple has most of their critical apps as part of the OS. So again as others have said, both are doing the same thing, the only difference is Apple tacks on a newer version number on their OS and looks like they're doing a better job of keeping their devices up to date. How many times have we seen Apple release their new OS for older models but with an asterisk? But when you dig deeper most of the benefits of the newer OS version are nowhere to be found on the older models.
If I was to complain about anything, it's that I think they should continue security patch support for longer than three years. Hell make it four years to match Apple's support. Even if Google did do version updates for longer than 2 years, many of the newer features are hardware dependent, so older devices wouldn't get them anyway, but with security patches they could continue to use the older hardware for longer and still be secure. If they're as committed to security as they claim, that would be putting their money where their mouth is.