Bush may be the lamest of lame duck presidents, but there's one area where even the lamest duck president could do a lot of mischief if so inclined, Under our system there's little meaningful restraint on the ability of the president to order attacks on foreign countries under the best of circumstances (since 1950, anyways) but what restraints there are lose all their power in the waning days of an administration.
Obama has clearly taken positive steps to exert leadership on the economy, our most pressing issue, even before taking office, but he also has deftly covered his foreign policy flank by keeping Gates on as SecDef.
There are many very good reasons to keep Gates on, and I'm sure they counted most in the decision. But the happy result of this decision has been to essentially remove the ability of Bush to start trouble with Iran. While it's true that Gates still works for Bush officially, he's now also Obama's man and has every incentive to make sure that nothing stupid is done in these last 48 days to screw things up for the new team.
Another well-handled move.