The attempt to prosecute Burgess failed because of the actions of the undercover cop
Burgess was a careful murderer (as shown later in the episode). He was very good at eliminating forensic evidence of his crimes. So, after the initial murders, the police did not have enough evidence to convict him. Hence the use of an undercover policeman in an attempt to gather more concrete evidence to procure a solid case that would stand up in court.
But Burgess may have known about the cop (this is not entirely clear but Burgess is very smart). Whether Burgess knew or not, some event provoked the undercover cop into a violent act and Burgess was beaten badly. This completely undermined the case against Burgess (possibly because any evidence presented by the undercover policeman was regarded as entrapment or, possibly, because he had not gathered enough concrete evidence before the incident to ensure a conviction).
We know this because Burgess actively boasts (during a press conference in the middle of the current investigation) that he had previously been exonerated and the police are trying to unfairly persecute him. This makes it harder for Luther and the police to pursue their current investigation.
The point is that the police can't prosecute someone successfully even if they are very certain of their guilt unless they can find enough solid evidence that will stand up in court. Luther only finally succeeds by using some dubious tactics to convince Burgess that he hasn't cleaned his murder scene sufficiently and then catching him at the murder site with the body. That is strong enough evidence to convict and Burgess, though a victim of entrapment, can't prove that as none of the evidence of Luther's scheme is available.