The shooting was actually faked to get Deeks back into the LAPD undercover to find a mole.
In this episode, the team works a joint operation with the LAPD to stop an explosives sale. During the sting, Deeks appears to shoot an unarmed man, leading Hetty to "fire" him and the LAPD to cut ties with NCIS. Ncis Los Angeles 3x10
LAPD Lieutenant Bates acknowledges that Deeks has found a "home" with the NCIS team. He encourages Deeks to finally sign the papers and make it official. The shooting was actually faked to get Deeks