The F-35A is only like 40% more expensive per-unit than the Gripen and is arguably at least 40% more capable (the payload alone beats that). It's true that the development program was a boondoggle (though Saab isn't completely clean here either), but that cost isn't for the most part borne by the export customers.
Economy of scale continues to rule all, basically, and there are already 3x as many Money-Gobbling Monstrosities in the air as there are Gripens.