PHOENIX - President Obama chastised the defense industry and a freespending Congress yesterday for wasting tax dollars on weapons and strategies better suited to fight Soviet armies on the plains of Cold War Europe than insurgents in the mountains of Afghanistan.

Telling the Veterans of Foreign Wars national convention that such waste was unacceptable as the country fights two wars while mired in a deep recession, he vowed to veto any such spending and declared: “It’s inexcusable. It’s an affront to the American people and to our troops. And it’s time for it to stop.’’

Obama also defended his decision to send 21,000 more US troops to Afghanistan against critics who warn of the military getting bogged down as in Vietnam. He acknowledged fierce fighting against Taliban and other insurgents leading up to Thursday’s national elections in Afghanistan after July was the bloodiest month yet for US and coalition forces.

“The insurgency in Afghanistan didn’t just happen overnight. And we won’t defeat it overnight. This will not be quick nor easy,’’ Obama said.

But, he added, “This is not a war of choice. This is a war of necessity. Those who attacked America on 9/11 are plotting to do so again. If left unchecked, the Taliban insurgency will mean an even larger safe haven from which Al Qaeda would plot to kill more Americans. This is not only a war worth fighting. This is fundamental to the defense of our people.’’

As to Iraq, Obama reiterated his commitment to remove all combat brigades by the end of August 2010 and to remove remaining troops from the country by the end of 2011.

Obama, in his third VFW appearance, but first as president, received hearty applause and standing ovations as he spoke at the Phoenix Convention Center to several thousand veterans, though only about two-thirds of the seats were filled. That may have been partly because he started his speech nearly an hour before it was scheduled. Aides say he was eager to get back to Washington after a four-day trip out West that was part family vacation and part business, including town hall meetings in Montana and Colorado to push his health care agenda.

Obama told the veterans that overhaul would not change how they get their medical services - and that nobody in Washington is talking about taking away or trimming their benefits. Instead, he’s instructed senior aides to work with the secretary of veterans affairs to come up with better ways to serve veterans.

Even at a time when Obama needs as much congressional support as he can summon for his health care priorities, he spared no party from his harsh critique of business-as-usual by some in the military establishment, some defense contractors, and some lawmakers who write defense budgets.

He assailed “indefensible no-bid contracts that cost taxpayers billions and make contractors rich’’ and lashed out at “the special interests and their exotic projects that are years behind schedule and billions over budget.’’ He took on “the entrenched lobbyists pushing weapons that even our military says it doesn’t want’’ and blasted lawmakers whose impulse he said was “to protect jobs back home building things we don’t need.’’

He sounded much like his campaign rival, Republican Senator John McCain of Arizona, whom he praised for seeking to rein in costs and reform the weapons-buying process.

Instead, the president laid out a vision of a nimble, well-armed, and multilingual fighting force of the future. “Because in the 21st century, military strength will be measured not only by the weapons our troops carry, but by the languages they speak and the cultures they understand,’’ he said.

But the transformation certainly won’t be easy to complete; lawmakers protecting jobs at home are certain to put up enormous fights over Obama’s efforts to stop production on weapons like the F-22 fighter jet.

Despite objections and veto threats from the White House, a $636 billion Pentagon spending bill was approved by a 400-30 vote in the House late last month. The Senate will deal with the bill next month. It contains money for cargo jets that the Pentagon says aren’t needed, an alternative engine for the next-generation F-35 Joint Strike Fighter that military leaders say is a waste of money, and a new presidential helicopter fleet.

“Among its other capabilities, it would let me cook a meal while under nuclear attack,’’ Obama joked. “Now, let me tell you something. If the United States of America is under nuclear attack, the last thing on my mind will be whipping up a snack.’’

© Copyright 2009 Globe Newspaper Company.