Yes, maintaining AIG bonuses helps government programs, because the public knows that the government will do what it says it is going to do. After the revolutionary war, the United States decided to pay back its war bonds. That made people want to loan money to the United States in the future. The same is true with AIG.
Maintaining AIG bonuses does not help government programs. While AIG claims that the bonuses were necessary because they were following contracts, I am sure there was some sort of clause in those contracts that could have gotten them out of it. The bonuses did not help the government at all because AIG was spending taxpayers' money to give bonuses to already rich people.