To justify her bad actions along the way, former Theranos CEO Elizabeth Holmes really believed that she was doing something positive for the world, author John Carreyrou told CNBC's Jim Cramer.

"She really did believe that creating this machine that would be able to run every test known to man off of just a pinprick of blood, that that would really be good for society and that it would do good," Carreyrou told the Mad Money host. "So I think she has this condition called noble cause corruption, which is that she ultimately believed that what she was going to achieve once she got there was gonna be a good thing for humanity. Therefore, every lie and every corner she cut along the way was justified."

Carreyrou's book "Bad Blood" tackles the rise and fall of Theranos and Holmes, its founder. The Silicon Valley darling, at one time valued at $9 billion, claimed that it only needed a microscopic amount of blood for its automated blood tests. Through his reporting in the Wall Street Journal, Carreyrou found that the technology did not work as promised, and that the biotech company misled customers about the methodology and accuracy of its tests.

"Unfortunately, over the years, [Holmes] ran into setbacks with this vision of a blood-testing device she was trying to pursue, and instead of admitting those setbacks, admitting to her investors where she was with the progress, she lied," Carreyrou said. "And the lies got bigger and bigger, and eventually the lies got so big relative to reality, that it became a pretty massive fraud."

Walgreens had hired a laboratory specialist in 2010 as part of their due diligence before partnering with Theranos. When the consultant tried to alert Walgreens about his suspicions in late 2010, executives ignored him, according to Carreyrou.

"They were so afraid that Theranos would turn around and strike a deal with their rival, their arch-rival, CVS that they just ignored their own in-house consultant," Carreyrou said.

Theranos used the Walgreens partnership to raise $700 million from investors, despite the fact that the company had to used hacked commercial machines — not its own device — to run blood tests. To test such small amounts of blood with those machines, Theranos had to dilute the blood, which caused issues with the tests' accuracy, Carreyrou said.

"Aside from endangering the public health, which they did by doing that, the key thing to remember about that decision is the company was running out of money then, and so by going live with the technology, they were able to solicit new funding," Carreyrou said.

In the end, the company had to void nearly one million blood test results, Carreyrou told Cramer.

In June, founder Elizabeth Holmes was indicted on criminal charges related to wire fraud and stepped down as CEO. If convicted by a jury, she could spend 20 years in prison. Three months earlier, Holmes settled with the Securities and Exchange Commission, agreeing to pay a $500,000 fine. The SEC also barred her from serving as an officer or director of a public company for 10 years.

Federal prosecutors also filed criminal charges against the company's COO and Holmes' ex-boyfriend Sunny Balwani. The charges that both are facing involve defrauding investors, as well as doctors and patients.

After being behind the scenes for years, Balwani formally joined the company in 2009. It was at this point that Carreyrou said that the company culture of fear went into overdrive.

"From that point on, they ran the company as a couple, and they perpetrate the fraud as a couple," he said.