According to the linked article, Iraq and Afghanistan cost over $1T (and this was as of 2011 and does not include things like health care, replacing degraded equipment, etc.) and the Vietnam war cost $738B.
It may be the first time a weapon system would qualify as a folly by itself (per The March of Folly, by Barbara Tuchman):
* Perceived as counter-productive in its own time (not just hindsight)
* Has clear alternatives
* Decision made by a group, not a single individual
It's generally worth noting that Tuchman's follies, and more recent cases that clearly fit her criteria (Iraq and the F35) seem to be follies in a fractal sense: you can just drill down and down and see more stupid as you go -- e.g. given you are fixated on going into Iraq, perhaps you include the State Department in the planning? Nope. Listen to your most experienced military leaders? Nope. At least make use of comprehensive existing plans for invasion? Nope. And on and on. With the JSF there are so many bad decisions bundled into the thing that it's hard to know where to start.