Tom 100% blew it up by warning Logan.
The thing about Tom the entire time is that he's been watching, paying attention and waiting. Initially, he was happy to work his way up the corporate ladder leveraging his marriage to Shiv, because she wasn't a "threat" to his position in the company as long as she was working as a political consultant.
But her getting involved in the company changed everything for Tom, particularly when she became a candidate for CEO and began being mostly dismissive of Tom's aspirations: "Oh yeah... yeah... you'll be there..." was often her refrain.
Tom deciding to offer himself up to prison to Logan was the key turning point for him, because it changed the nature of his relationship with both Logan and Shiv. He saw how Logan had a new respect for him and he also saw how Shiv didn't necessarily give a shit that he was going to go to prison.
The diner scene with Kendall laid out Tom's intentions. He was always going to side with Logan. Because, as noted above, he's been watching and he knows that Logan would figure out a way to outmaneuver the kids.
Also, this: