It's because most chemical weapons are either not actually very effective weapons physically, or because they are hard to control, or they contaminate areas for many years ahead. And pretty much all of them are excessive.
Some chemical weapons just do not kill as efficiently or certainly at the same cost as a conventional weapon. The only reason they are used are because they don't kill efficiently, but painfully. They are used for their psychological effects, not for their physical effects. They are used to instill fear. However, more often than not this backfires and people tend to band together when they have an enemy that they can easily put a "literally hitler" badge on. So they aren't really that useful even as psychological weapons, but militaries will still insist on using them for some reason. It's like strategic bombing in ww2: It's expected to work, it doesn't actually work, but they keep on doing it.
A lot of chemical weapons include smoke. It's quite hard to control where the smoke will be moving, so you might end up hurting your own soldiers or civilians. It's also hard to control the fragments from conventional bombs or explosives, but they usually loose most of their lethality after around 100m, depending on the explosive, and you can use physical objects to stop the fragments. Smoke can travel much further than that and it flows around corners and through holes in buidlings, filling up most rooms if used inside a building.
Some chemicals may be absorbed by the ground and remain toxic for years to come. Not great once a war is over and people start to live on the soil where battles have taken place.
Lastly, they often do excessive damage. Human bodies are surprisingly hard to kill with conventional guns, as long as they have access to good medical care before they bleed out. A shot will probably make you unable to keep on fighting, so guns are still very effective. But they give people a chance to survive. Chemical weapons can do the same thing, but pretty much always need to do a lot more damage to the body and will pretty much always leave more long-lasting damage. It damages the body by an excessive amount to do the same thing a gun or conventional explosive does.