Because he wants to win the election, or rather, prevent Trump from getting the nomination outright, and position himself in a contested convention.
Look, love or hate Cruz, he's a really good politician and smart guy (Princeton & Harvard - as Texas Solicitor General he argued multiple cases before the Supreme Court.) He's won a big election (Senator from Texas) and has run a pretty credible presidential campaign. So in choosing Carly Fiorina as his running mate he's calculated the odds. I'm not inclined to second-guess him on the politics.
A few factors probably include that she's a woman and a good campaigner. She might send a signal to the "establishment" (if such a thing exists) that Cruz is a sober figure who can at least talk to the party moderates. Most importantly, she creates buzz when Cruz is in big trouble. Trump's sweep last night makes it increasingly likely that he'll get the nomination outright. Anointing her is the emergency parachute cord.
Will it work? Who knows, maybe? Probably not. Even if Cruz somehow derails the Trump train (and I for one sincerely want this), the political scientist in me doubts we can really prove there was a Fiorina effect.
Anyway, the last time a GOP presidential candidate selected a woman as his running mate, it did not go well (and this odd video harks back to that unfortunate decision.)
Fiorina as Governing Partner
I don't claim to be much of a pundit and there are plenty of people making a lot more money that analyze elections. I studied what VPs do in office. Here I don't see that Fiorina brings much to the table.
Fiorina was a CEO of a big company. Her record as CEO was, um, controversial. But let's grade on a curve here and say anyone who even gets that far is pretty smart and capable. (Debatable of course, but bear with me.) So she knows something. But I have become extremely skeptical of business talent correlating with political talent. They are fundamentally different capabilities. Businesspeople make money, in politics the outputs are more complicated and the constraints are more extensive. The record of businessperson politicians is not inspiring (Herbert Hoover, Andrew Johnson, Jimmy Carter). Harry Truman, on the other hand, was a failed businessman.
Cruz is not a vastly experienced politician. He has a little time in the Senate and he presumably knows something about the law. But a fundamental paradigm of my research is that outsider presidents who are not deeply familiar with how Washington works are well served in choosing an insider VP who can help them. Cruz is an outsider, he will need help working with Congress. understanding the federal bureaucracy, and communicating with the Washington press corp. Carly Fiorina has nothing in her background that suggests she has any particular assets in this arena.