The events that kicked off the series saw David Budd stop a terrorist attack on a train and it was a gripping opening that had everyone on the edge of their seats. As the investigation into the attempted-attack went forward it saw the Police and the Secret Service constantly butting heads over who should lead it. The Police and Anne Sampson seemed so desperate to be the ones leading the charge.
Plus, they're not stupid - they'll be aware of David's record from the Army and probably already know about his PTSD. Allowing a potential security risk to be a Protection Officer to the Home Secretary seems like an odd move unless they're doing it to set David up as a scapegoat for her death. They're slowly uncovering David's ties to the shooter from the second episode and the evidence is slowly building that makes him look guilty.
When David attempted to shoot himself but the rounds had been swapped with blanks. He obviously hadn't done it himself but the police had recently swept his house after the attacks which would have given them the prime opportunity to tamper or place incriminating evidence.
But why would they go to all the trouble of setting David up? It's likely to do with the RIPA charter that Julia was trying to get through Parliament as this would've taken away certain powers that the Police have in terms of security and given them to the Secret Service. Any ambitious members of the Police would have their wings cut and career prospects dwindle. By killing Julia and proving that anyone could become a threat the Police could move to get RIPA scrapped, and their reach wouldn't be cut.