Obama's decision to complete the withdrawal from Iraq was probably better policy than it was politics -- and it was the right call both for America and for Iraq.
In many ways, it would have been safer politically for Obama to keep the residual force in Iraq which hawks demanded to insulate himself against charges of having "lost Iraq". But it would have been wrong on policy.
It's not just that the U.S. was obligated by the SOFA to withdraw its forces, once it proved unable to negotiate the terms of an extended troop presence with the immunity provisions which the Pentagon demanded. It's that the remaining U.S. troops could do little for Iraqi security, had little positive effect on Iraqi politics, and would have soon become an active liability.