Spads are tied to ministers they advise to - so if the minister quits / is fired, they go as well.
They all resign as a matter of procedure when Parliament is dissolved for an election. They’re political advisors appointed by the party, not civil servants, so it would basically defeat their purpose if they were bound by purdah rules.