There is a thunderstorm in Santa Barbara that has been causing the electricity to flicker on and off, but that doesn't stop Lassiter from making the bust of his career. Five years ago, he arrested Ernesto Chavez, second in command of the Cinco Reyes street gang, but the D.A. couldn't make the charges stick and Chavez disappeared. This time around, they've got enough hard evidence to get a conviction, something that Detective Drimmer and his gang unit has been unable to do. Everyone turns to watch Lassiter bring in Chavez, who glares at McNab as he walks by. Lassiter, then, hands off Chavez to be processed and put in a cell as he is called into Vick's office where the FBI is waiting for him. Lassiter is furious to learn that Chavez cut a deal with the Feds and will be entering a witness relocation program, thus avoiding prosecution. Vick orders an angry Lassiter to retrieve Chavez from his cell and turn him over. He leaves and the lights flicker out once again, only this time a shot is heard in the darkness. The lights come back on and everyone runs down to the holding cells to find Lassiter standing over a dead Chavez with a smoking gun in his hands.
Shawn immediately notices that Lassiter's finger is not on the trigger of his gun, a service door is ajar and an overhead light remains off. Lassiter tells Vick that when the lights went out, he was accosted from behind and lost his weapon. The gun discharged, the lights came back on and he saw Chavez dead. He was picking his weapon back up when everyone arrived. The FBI doesn't believe Lassiter's story, but Vick sides with her head detective and orders Juliet to lock down and search the building. But, following protocol, she also insists on running ballistics and fingerprints on his gun, and getting a full written statement. After Juliet tells Vick the search turned up nothing, Detective Ocampo from Internal Affairs questions Lassiter who is shocked to hear he's a suspect as his hands are checked for gun shot residue. Shawn assures Lassiter he believes in his innocence and the next day Chief Vick shows up at the Psych office asking him to prove it. Ocampo got a hold of Madeleine's psych evaluation of Lassiter and things don't look good. She asks Shawn and Gus to join the search of Lassiter's apartment to see if they can find anything to vindicate him. Things go from bad to worse as they find an obsessive array of mug shots and notes on criminals covering one wall, plus the GSR test comes back positive and the bullet that killed Chavez was matched to Lassiter's gun. That's all that Ocampo needs to hear, and Vick is forced to place Lassiter on suspension and confiscate his badge.
Back at the police station, Ocampo is pushing Vick to arrest Lassiter but she refuses until a thorough investigation is complete. In the meantime, she orders Juliet to continue her police work and temporarily assigns Drimmer as her partner. Lassiter is determined to clear his name and goes to Shawn and Gus for help. He's compiled a list of Chavez's enemies but Shawn quickly dismisses all of them. He says Lassiter is holding back information on the killing, then blindfolds him and tells him to remember what he heard that night. Lassiter remembers hearing a faint squeak, so the guys head back to the station to check it out, forcing Lassiter to wait in the car. Juliet tells Shawn and Gus that there was a vagrant named Kenny Loggins in another cell that night but he was passed out drunk and didn't see anything. She then leaves with Drimmer, and as Lassiter watches them pull out, he gets out of the car and walks forlornly away. Down in the holding cells, Shawn finally gets into the service room and discovers a breaker box where one of the switches is off. He flips the switch and the light that was out before comes back on. He then goes into Kenny Loggins' holding cell and discovers the squeak coming from the bed. He realizes that Kenny was in fact awake and hiding underneath the cot, having witnessed the whole thing. But before they can question him, Loggins turns up dead.
Shawn and Gus catch up with a depressed Lassiter and take him to Henry's so as not to leave him alone. Shawn confesses to Henry he suspects a cop, and his dad warns him to be careful with those suspicions. They sneak into the records room to find anything that connects Loggins to someone in the department, but after rifling through the files and getting black smudges on his fingers, Shawn discovers that all records of Loggins have been expunged. They run into Juliet who tells them she saw Ocampo, a man whose political career would be enhanced with the take down of a senior police officer, in the records room earlier shredding papers. Shawn and Gus then take the shreds to the Psych office to reassemble them with Henry, but it turns out to just be Ocampo's credit card bills. Shawn leaves to buy peanuts from a vendor outside and runs into Drimmer who is out for a jog. Drimmer asks Shawn where he is on the Lassiter investigation, but Shawn notices black smudges on his hands and realizes he's talking to the real culprit. Drimmer figures out he's been made, and knocks Shawn out. Shawn wakes up in Lassiter's apartment as Drimmer sets a trap to kill them both. Shawn realizes that Drimmer had to kill Chavez because on the gang unit, he was on Chavez's payroll. It was Drimmer that Chavez glared at when he entered the station, not McNab. With Chavez about to turn state's evidence, Drimmer needed to silence him for good. When Shawn never comes back into the office, Gus and Henry go to the station looking for him. They tell Juliet the last time they saw Shawn he was talking to Drimmer outside the office, but Juliet says Drimmer told her he was going out of town. Juliet says they can track him through his phone and they take off. Meanwhile, Drimmer has texted Lassiter pretending to be Shawn and when he shows up, he walks into Drimmer's trap. But Lassiter has hidden guns in his apartment and is able to get the upper hand, saving Shawn and finally clearing his name as Gus, Henry and Juliet arrive to take Drimmer into custody.
The title appears to be a play on the Chris Isaak's song, "Baby Did A Bad Bad Thing".
The gallery for Lassie Did a Bad, Bad Thing can be found here.