"promised he would stay regardless of the result."
At a guess he'd never anticipated the result and didn't expect to deliver on that. Not surprising - he was a politician. Having lost the vote he realised not only that it was a stupid promise to have made and that if was to be implemented it would need someone who believed it was a good idea and had planned for it to do so. He could have seen that if he'd stayed on he'd have been in May's position - struggling to put something together while the ERG and camp followers complained about everything he did to try to put their nonsense into practice.
You can scarcely blame him for the fact that the group of those who believed it fell apart. Maybe they were of the same opinion - they didn't expect to win and didn't believe it was a sensible scheme. Maybe their only position was to heckle from the back benches and they couldn't keep doing that if they were in government. Were they emboldened in their campaigning by the belief that he would actually stay on and do the heavy lifting for them and take the blame for failing? I don't know. You'd need to ask them.
But you can't logically complain that he didn't stay on while elsewhere claiming he should have handed over the reigns.