Because whichever devices use stock Android like Nexus/Pixel/OnePlus/Motorola are getting updated to the latest versions at least for 2 years. Only those which are using their own skin like Samsung or Xiaomi aren't.
It's virtually impossible for Google to push a ROM feature to all devices because of the different types of hardware/OEM skins being used! If OEMs want to use latest OS features like Doze, they better stick to stock ROM and provide updates to their users. It's not Google's fault.
Btw, Greenify doesn't work automatically on non rooted devices (Work around is there by providing usage access, but that's not as convenient as auto).