The speaker defied expectations and delivered a debt limit agreement that few thought he could manage, but left some of his Republican colleagues feeling betrayed.