First off, this code is not always respected by cartel members in real life.
While I'm sure real world cartels would just love to see the kind of commitment from their members that fantasy world cartels enjoy, cartel members do in fact rat. All the time. For lots and lots of different reasons. It took me approximately six seconds on Google to find an example. Here's another one.
That said, fear is probably a major factor.
Even assuming the informant can avoid prison (where he'd be an easy target), he can probably expect there to be attempts on his life and the lives of his family. One cartel lawyer was gunned down, and Jorge Cabrera (from the second link above) had to go into Witness Protection with his family since the Cartel wanted him dead too. One does not have to look too hard to find examples of the kind of extreme torture and violence that cartels are capable of. This has to be a huge deterrent to informing on them.
There is also an element of protecting the cartel in this.
Not so much an issue for Jesse, who did not know much, but if Salamanca ratted on Gus, then Gus could turn around and give information that could hurt the cartel. You don't want to hand over a guy to the authorities who knows all your people's secrets.
Law enforcement is seen as the greater enemy.
I think in the case of Hector Salamanca (which of course is fictional), his hate of Jesse or Gus Fring was somewhat superceded by his visceral, ingrained hatred of the DEA and law enforcement in general. There may be some truth to this. The conflict between Mexican cartels and the DEA/Mexican authorities has been much like a war at times, and an especially bitter one at that. Enrique Camerena was a DEA agent who was kidnapped by a cartel, and tortured, burned alive, and murdered. That's not business. That's personal. Salamanca had been fighting Fring really for a year or two. Jesse had crossed him once, and the DEA really did the damage in that case. By contrast Hector had been fighting the authorities his whole life.
Hector was holding out hope for getting revenge himself.
Sending Gus or Jesse to prison, where they could get protective custody, 3 square meals a day, and yard time probably seemed like small revenge for Salamanca for what they had done to him. And that's if his testimony could actually put Fring away... hard to say for sure with the US Justice system protecting Fring's rights in a way that Mexicans probably find baffling. Even if they went to jail and the cartel could get them, Salamanca wouldn't be there to witness it. So perhaps Hector was hoping for that one in a million shot that somehow he might be able to get revenge on them someday as long as they stayed free... and wouldn't you know it? In the case of Gus, he did.