Actually he was hugely outmanoeuvred and stabbed in the back by Michael Gove.
Boris and Gove had a deal before the vote: Boris would be PM and Gove would be Chancellor. Boris went around getting the support of Tory MPs to ensure a successful bid. But unbeknownst to him, Gove had been doing the same thing. Boris has the support of ~90 MPs yesterday, and was on the verge of announcing. But Gove announced this morning, taking around half of those MPs with him. The support of pro-Leave MPs now clearly with Gove, Boris had no choice but to abandon his plans to run for leader.
Gove did other underhand things as well. For one thing, his wife "accidentally" sent an email critical of Boris to the press, instead of (presumably) to Michael Gove. Bear in mind that Gove's wife is a writer for the Daily Mail, so it's not like she isn't media savvy.
But perhaps more damningly is that Gove was sent a copy of the Telegraph article that Boris had written a couple days ago. The article was a complete disaster for Boris, as it was terribly muddled, contradictory, and poorly written. Boris himself regrets publishing it. But he gave it to Gove to check over, and Gove made a few changes himself. It seems as though Gove, had he been a more honourable man, would have recommended that Boris scrapped the article and start from scratch, rather than publish an obviously stupid article in a national newspaper, days before announcing his bid for PM. However, Gove not only gave the all clear, but actually made changes himself. Very sneaky, very dishonourable.
So yeah, the only one who comes out looking good from all of this is Theresa May, who has largely remained anonymous throughout.