The war on terrorism, which was expanded to include a war in Iraq, accounted for only a part of the government’s debt: from 2001 to 2004, spending outside defense, homeland security, and defense-oriented foreign aid had jumped 23 percent, or more than 7 percent annually.