House Republicans put on quite a show of incompetence Thursday. It all began midday when House Speaker John Boehner squashed his party’s bill to address the border crisis after it became clear it wouldn’t pass. Then, after originally telling his members that there would be no more votes before the August recess, Boehner convened an emergency meeting, leaving some members scrambling to return from the airport. Finally, the House leadership told their caucus to stay in D.C. another night while they decided how to proceed.

What a mess.

Senator Ted Cruz—who else—successfully lobbied right wingers in the House to oppose Boehner’s bill, because it provided money to the president without forcing him to end his 2012 executive action that allowed undocumented children to stay in the U.S. legally, known as Deferred Action for Childhood Arrivals (DACA). Not only did Cruz’s actions embarrass his party, but his policy position is also misguided. That’s because it’s almost impossible to determine the specific reasons for the border crisis. Increased violence in Central America, predatory human traffickers, DACA and many other reasons all likely contributed to it. Yet, Cruz has placed the blame almost entirely on Obama. In doing so, he’s held much-needed funding hostage unless the president accepts his unreasonable demand that he undo DACA.

And make no mistake, that funding is desperately needed. Immigrations and Customs Enforcement (ICE) and Customs and Border Protection will run out of funding in mid-August and mid-September respectively. Thus, Cruz’s actions could actually put our border security at risk. Once again, the Texas firebrand has put his own politics ahead of both his party and the country.

That’s not to say the two parties would reach an agreement without his involvement. They’re still far apart on a number of key issues. But Cruz’s efforts serve only to undermine the House GOP leadership by pulling the party further to the right. Boehner and Co. were determined to prove to America that they could actually govern. Thanks to Ted Cruz, they proved the opposite.