If I were in any kind of law enforcement, as a matter of personal safety, I would assume every perp was armed until I saw different or heard "clean" from another officer. I believe that is SOP. It's not a ticket to pull the trigger, though.
I could understand these guys getting wound up in the heat of things and pulling the trigger on this guy. That doesn't make it right, but I can get my mind around it. What I can't understand is the cover-up and refusal to report the incident.
I think Compean freaked (for whatever reason), and Ramos took a fall because (in the heat of the moment) he tried to cover-up in order to protect his partner.