There are two elements in this:
- The Dead Men's original oath, and,
- Isildur's curse.
The assumption that Isildur's curse was the primary factor in the Dead Men's eventual fate may not be entirely valid. Oaths in Tolkien are powerful stuff. Perhaps the best example to compare with is the oath of the Feanorians:
They swore an oath which none shall break, and none should take, by the name even of Ilúvatar, calling the Everlasting Dark upon them if they kept it not ..... For so sworn, good or evil, an oath may not be broken, and it shall pursue oathkeeper and oathbreaker to the world's end.
The implication here is that the breaking of the oath was what actually sealed their fate, but Isildur's curse just made things a little more specific.