Why weapons like flamethrowers are permitted by the Geneva Convention
At a quick glance, the rules as outlined by the Geneva Conventions on which weapons are allowed (and disallowed) to be used in combat make little sense. The objective of combat is, ultimately, to put an enemy down so the conflict will end — and yet such killing must be done via the most humane means available.
Weapons like a nuclear ICBM are strongly condemned by the international community — but a depleted uranium tank buster round is fine. A Browning .50 caliber Machine Gun is entirely legal, but simply shaving a side of a bullet is a war crime. Incendiary grenades are banned, but (and it's very explicitly stated) a flamethrower was permitted and often used during the Vietnam War.
So how, exactly, do the Geneva Conventions delineate what is and isn't allowed when killing the enemy? It all boils down to two simple words: military necessity.
This idea of the Conventions was to keep war as humane as possible, not just for the sake of civilians that may be in the area of operations, but for combatants. This is achieved by limiting the infliction of undue harm.
It's understood that, by the very nature of combat, one side's troop will be required to end the life of the other, but such killing doesn't need to be sadistic or cruel. The previously-mentioned shaved bullet, or "dum-dum round," is banned because, instead of entering the human body and either exiting or stopping, a dum-dum round ricochets around the organs, causing an extreme level of pain before ultimately killing via internal bleeding.
Say the enemy is attacking troops from a positioned reinforced by armor. The troops in that position are allowed to use the lowest-level solution to counter enemy actions. Sure, an ICBM would technically get the job done, but that's escalating the situation to an extreme level, putting civilians at unnecessary risk. Still, The troops something to punch through that armor, like a depleted uranium tank buster round.
It's not quite as cut-and-dry as that, though. "Military necessity" accounts for what's available at any given moment. If troops roll up in a vehicle outfitted with an M2 machine gun and terrorists open fire, troops aren't required to fall back and find something a little less powerful than the .50 cal they have on hand.
That being said, the use of weapon, round, or weapon system must be carefully considered when there's a chance civilians are in the area. After all, the objective of a given conflict is to stop the enemy by whatever means — not to harm innocents.
With those qualifying factors in mind, let's consider a weapon like the flamethrower. Despite its reputation, this weapon wasn't designed solely to roast the enemy alive. The flamethrower's intended use is to clear out hard-to-reach tunnels and bunkers when sending in troops with only conventional means would likely result in their deaths. This same justification can be applied to thick forests or jungles.
It cannot, however, be used as the sole weapon of a troop, unless it is the only weapon on hand, and it cannot be used to specifically destroy the plant cover to prevent it from spreading, unless the plant cover is being used by the enemy as a military objective.
The aftermath of using a flamethrower isn't something that can be controlled, so it's highly discouraged, but not forbidden if used with caution.