As a point of comparison, Microsoft ships its OS across a variety of manufacturers and largely keeps it maintained across them (give or take some exceptions like enterprise environments & the like).
Even unlocked Android phones purchased independently of carriers have inconsistent lengths of support, so it doesn’t seem to be entirely a result of carriers, so…What happened here?
That’s because GNU/Linux uses open, generic interfaces to communicate with (often fairly generic) hardware.
Android/Linux usually uses specialised closed black-box interfaces to communicate with hardware and those usually only work on one specific device or at best a small family of devices.
This model is dictated by the vendors of the hardware.