Bet it was a bit like Brexit, everyone got fed up with deliberating so the need to bring a situation to a conclusion was the deciding factor, happens a lot.
It seemed a lot like Brexit in other ways. A tiny minority of republican representatives tried to block the proposed speaker because he was not right wing enough for them. Even though the majority of people voting republican returned republican representatives who were not so right wing. So they ignored the wishes of the majority and tried to push through their own minority agenda.
Did the Democrats vote for this speaker? Seems a missed opportunity for a spoiler vote if they didn’t, they could have voted for the most right wing or outlandish candidate in the Republican ballot and perhaps elected the candidate no one expected (assuming the vote was close - I am sure that they said the there was one vote in it on the 14th ballot but perhaps that is not how it works).
American voting is weird if they can deadlock themselves.