Legalization depends on the drug. We could certainly afford to be more lax than we are now. We could legalize and control the use of many drugs. Certainly not all. Drugs like fentanyl cannot be allowed to circulate freely. Even if we completely ignore the safety of the individual, the safety of society as a whole is threatened by such drugs.

Legalization will wipe out the drug gang operations due to simple economics. I don't think criminals can compete with actual pharmaceutical laboratories operating in the clear. Drugs would be cheaper and higher quality. In fact I seriously doubt drug gangs would support legalization of drugs. It would destroy their ridiculously high profitability. Their prices would be squeezed. They'd have to compete on quality and price. They wouldn't be able to eliminate the competition, impose cartels and control prices. Drug companies get rich due to patents which are government-granted monopolies, once they expire it's a literal race to the bottom, you actually need regulation in order to protect consumers. Some drugs actually disappear from the market because they are too cheap to be profitable.

Drug gangs are the career path of the favela denizens. Drug operations have lots of "employees" and they pay ridiculously well. Wiping them out via economic or military means will also wipe out all of those "jobs". It will do nothing to solve the underlying problem of a poor and disenfranchised people forgotten by society. They're likely to turn to other forms of crime if society doesn't integrate them, and it probably won't.

The hope is that whatever criminal activity they turn to will not be as profitable as the drug trade. Robbery isn't that big a problem in the grand scheme of things, drug gangs moving billions and billions of dollars absolutely is. All wars come down to money. Make enough money and you can have better equipment than police, militaries. You can raise armies, just like the middle ages. You can hire actual professional soldiers to train your men. Crime that's too profitable is literally a matter of war. Common criminals are a thorn on our side but in the grand scheme of things they are mere nuisances. Well-funded criminals are an existential threat for civilized society.

War on these groups would require enormous political capital. Television networks would probably have to spend years manufacturing consent for it. The fact is left has infiltrated the entire country and they practically worship these "victims of society". Literally days ago we were forced to listen to our president say that drug traffickers are victims of their consumers. I have no idea what it takes to reverse this sort of brainwashing but whatever it is we'll need lots of it.

If by some miracle the military is deployed against the drug gangs, the gangs will be routed. It's happened before and will happen again. Drug gangs do not have the training, the discipline, the sheer organization required to stand up to actual armed forces. Even our pathetic military has managed to prevail against them. It's the politicians who get in the way. There's no point in "pacifying" an area and then retreating from it, thereby allowing the enemy to occupy it again.