Couple things going on here:
1)Cruz is making a play for the weak and stupid wing of the GOP base. They have Trump fatigue and want validation for wanting Trump gone. Even if it means being ruled by Marxist Democrats. So Cruz gives them what they want and hopes they will see him as a future conservative standard bearer.
2)Everybody in the swamp GOP wants Trump to lose in 2024. They’ll do all they can to be divisive in the run up to 2024. They know all they need to do is get some GOP voters to stay home in 2024 to defeat MAGA.
Yes, they would rather lose and stay in the minority than rule with a conservative president like Reagan.