Castor, a former Montgomery County district attorney, testified in a pretrial hearing in Norristown, where attorneys for the entertainer are asking a judge to drop recent charges accusing Cosby of sexually assaulting Andrea Constand at his home in 2004.
Cosby's lawyers contend that charges filed late last year by Castor's successor should be dismissed because Castor announced in 2005 that Cosby wouldn't be prosecuted.
Castor testified Tuesday that he did so in part because he didn't believe the case was strong enough for a conviction.
"Mr. Cosby was not getting prosecuted, at all, ever, as far as I was concerned," Castor testified Tuesday. "... I made the decision as the sovereign that Mr. Cosby would not be prosecuted, no matter what."
His other reason for not charging Cosby? Castor said he thought the move might help Constand successfully sue the entertainer.
Castor essentially conceded that the only reason Cosby testified in Constand's subsequent 2005 civil suit -- the very testimony that prosecutors are now using to charge him -- was because he took prosecution off the table.
When Castor declined to prosecute in 2005, he said, Cosby couldn't claim Fifth Amendment protection against self-incrimination in the civil suit.
"Cosby would have had to have been nuts to have said those things (in the civil deposition) if he thought he was going to be prosecuted," Castor said.
But, Castor told Cosby's lawyers Tuesday: "I'm not on your team. I want them (the prosecutors who've charged Cosby) to win."
During cross-examination, there was also a tremendous amount of detailed scrutiny of quotes and documents attributed to Castor. The state suggested they show Cosby wasn't protected from criminal prosecution by the state.
The pretrial hearing will resume Wednesday morning.
Other legal matters for Cosby
Also Tuesday a civil case against the legendary comedian in a California court was dropped by a woman who had claimed Cosby sexually assaulted her at the Playboy Mansion in 2008.
Chloe Goins, now 24, filed a court document allowing the case to be dismissed.
Last month, a prosecutor in Los Angeles County declined to pursue
a criminal case, saying evidence was insufficient to prove a crime was committed. Investigators learned Cosby was in New York the weekend of the event at which Goins said Cosby assaulted her.
The charge in Pennsylvania
Cosby was charged December 30 with aggravated indecent assault against Constand, one of a long line of accusers and the first to go to authorities, in 2005.
According to the affidavit of probable cause, Constand alleges Cosby drugged and sexually assaulted her in his Pennsylvania home in 2004, after inviting her there to discuss her professional future.
Castor did not file sexual assault charges against Cosby in that same year, citing "insufficient credible and admissible evidence."
Constand, a former director of operations for Temple University's women's basketball team, met Cosby in 2002 when, according to prosecution documents, she believed he sought her out to be a "mentor" and "sincere friend."
Constand's civil suit alleged battery, sexual assault and intentional infliction of emotional distress.
It was settled in 2006 with a confidential settlement agreement but not before a judge compelled Cosby to answer questions under oath.
That deposition was sealed for the last decade but parts were unsealed last summer by a federal judge. The Montgomery County District Attorney's Office, then led by a different prosecutor, reopened the investigation based on "new evidence" from that now public deposition.
That new evidence, according to prosecutors, centers on a question from Constand's civil attorney Dolores Troiani and Cosby's response during the sworn testimony:
Q. "When you got the Quaaludes, was it in your mind that you were going to use these Quaaludes for young women that you wanted to have sex with?"
Cosby later stated in the deposition he was only referring to one unnamed woman.
According to Cosby's own 2005 deposition testimony
, he admitted sexual contact with Constand, but said it was consensual.
Castor: I had bound Pennsylvania to my decision
On Tuesday, Cosby, wearing a brown suit, listened as Castor said he warned his successor in 2015 -- then-District Attorney Risa Vetri Ferman -- that the case had been "put to rest"
Castor testified that when he heard speculation last year that Ferman might charge Cosby, he reminded her by email that he'd already committed the state to not prosecuting the comedian.
"I knew I had bound the commonwealth as a representative of the sovereign," Castor said.
He added: "I wrote her an email explaining the situation from 2005 to tell her to tread carefully, because in my opinion, she was exposing herself to civil liability because the decision (not) to go forward with Cosby was put to rest in 2005."
He further explained to Cosby's attorneys Tuesday why he didn't pursue charges. He said:
• There were inconsistencies in Constand's statements to police. "Within days, she changed the day when it happened from March back to January '04."
• Those inconsistencies "would affect her credibility at trial."
• Constand contacted a civil lawyer before taking her allegations to police, and that also hurt her credibility. Castor said that Cosby's lawyer -- Walter Phillips, who has since died -- told him that Constand and her mother were trying to get money from Cosby in exchange for not going to police.
• "Making Mr. Cosby pay money to Ms. Constand (through a civil suit) was the best I was going to be able to set the stage for."
But Castor said he believed Constand.
"What I think and what is provable in a courtroom is two different things," Castor said. "... What I think is that Andrea Constand was inappropriately touched by Mr. Cosby."
"I did not think she could withstand cross examination to the point where reasonable doubt could be overcome," Castor added.
Newly elected District Attorney Kevin Steele argues that no nonprosecution agreement ever existed, saying in legal filings the DA's office has no documentation on it and they can't find anyone who does.
Cosby has yet to have his preliminary hearing and formal arraignment in the case.