I'm sure there was some money wasted along the way, but this makes me think of the often-quoted (around here at least) anecdote that VCs succeed not by getting decent returns across the board but by having one or two "home runs".
If Tesla is the home run that this ATVM program made possible, maybe it doesn't matter if all the rest end up defaulting on the loans (which this article doesn't even imply, Tesla seems to have just paid back the loan early). Obviously the economics of government loans aren't exactly the same as those of VC investments, but making the large-scale production of electric cars economically feasible is a huge accomplishment that seems like it'd be worth the cost of this whole program.