Darn, the ones I was going to suggest have already been suggested. Lett's try to think of some more.
Using up all of a resource. Perhaps they rely on some very complex chemical compound that they cannot reproduce (or for cultural reasons, are not willing to begin research into). The planet where the Spice is formed has a sun that'll go nova. They can't/wont transplant it.
They could all rely for their longevity on a single invention or device, controlled by a single person, company or organisation or religion, which loses the ability or desire to maintain those longevity devices.
Like Josiah's "genetic factors", they have a degenerative disease or population imbalance, which again they cannot or will not solve: perhaps they only noticed too late that their birth rate has become insufficient to restore their death rate.
Like the grey goo suggestion, and the voluntary suicide idea, they could hit the Singularity: their computers and robots could ultimately make their way of life completely pointless.
They could be working on a problem that would culturally destroy them: such as "is there a God", and finding definitive evidence that they were wrong would cause mass death.
Perhaps they discovered a method of immortality, so they just stopped reproducing as it was pointless: they didn't need to and it was wasteful of resources. Birthing in their hives, once done by queens, was no longer needed, and the queens, now being equal but having far higher needs for resources, were often rebelled against. And it was only some time after the last queen died, wen each planet asked around and discovered there were none to import, that they realized the immortality was ultimately their death warrant.
Or perhaps, as with vampires of lore, their immortality brought infertility. Economic considerations would mean that it's in a planet's best interests to grant immortality to all citizens, so's best to compete against other planets which have to spend the extra investment in nurturing the young and senescence of the elderly. And it was only once everyone was immortal that they realized they were all doomed.