There is more than one conspiracy going on
For most of the episodes of Bodyguard the audience knows there is some sort of conspiracy happening. A lot of the information points towards a conspiracy between the Home Secretary and the Security Services (led by Hunter-Dunn). When the Home secretary is assassinated after, apparently, going off-piste with the information Hunter-Dunn has given her, we (the audience) assume that the assassinations are part of the same conspiracy and, therefore, that the Security Service have tried to eliminate a rogue threat (the Home Secretary).
We are even fed direct hints that this is the case when the female suicide bomber says she recognises Longcross (a security service agent) while being interrogated by Budd (the bodyguard).
But, as the details of the events are revealed in the final episode it transpires that there are two conspiracies. In one, organised crime in collusion with a corrupt police officer are trying to kill the Home Secretary to stop her surveillance legislation which undermines their ability to subvert police investigations (the police are easier to infiltrate than the Security Service). This explains the assassinations. But the Security Service were conspiring with the Home Secretary to undermine the Prime Minister who didn't want intrusive legislation to hand more power to the spooks.
The two conspiracies don't appear to be linked except through the investigations by Budd which threaten to uncover the Security Service's dubious acts. So they have a common interest with the criminal conspiracy to cast Budd as a rogue patsy.
Or, perhaps, this was all disinformation to protect an even deeper conspiracy (though we are given no hints that this might be true). Most importantly, we don't need to suppose a deeper conspiracy to explain the Hunter-Dunn resignation: he was being forced out because conspiring to undermine an elected Prime Minister is going a little too far even for them. But this is a side-effect of the fact that the police ended up with the device containing their secret information on the PM that was only revealed because Budd was searching for the conspirators who killed the Home Secretary and thought it was the Security Service.
Both the major conspiracies also interact with a third conspiracy (albeit a purely political one) to prevent the Home Secretary from toppling the PM. Her deputy and one of her special advisors were trying to embarrass her by planting dodgy information in a major speech. This became mixed up with the other (deadly) conspiracies by the accidental timing coinciding with her assassination.
In short a number of parallel murky goings-on confuse both the audience and the in-universe participants about what is really happening.
The Hunter-Dunn resignation only relates to one of the conspiracies and the existence of the others is irrelevant to explaining why he had to go.