Yeah. As I understand the dynamic, the "Freedom Caucus" had decided they didn't like the guy, and were going to not vote for him. He might have been able to get the position, but with a small enough margin that his position would not be secure.
In short, the Freedom Caucus is, in essence, holding the operation of the House hostage. But, they are known to support measure like shutting down the government when they don't get their way.
One author I read today suggested that the more moderate Repulbicans could, in fact, form a coalition with some Democrats to elect someone to lead the House. I suspect his would probably be good for the nation, but not so hot for the re-election prospects of the people who did it.