Warren Allen, 54, was found unresponsive in his cell on Friday at Mountain Institution in Agassiz, B.C., where he was serving three years and three months for sexual assault and distribution of child pornography.
A news release said correctional officers immediately performed CPR, but he was pronounced dead in hospital in Chilliwack, B.C.
The Correctional Service of Canada has not released a cause of death, but noted police and the coroners service have been notified.
Allen, who was an RCMP officer 30 years ago, was targeted by Toronto police in an undercover operation after the force received a tip from the FBI.
Allen had bragged on an Internet chat line about how he and a friend sexually assaulted a 14-year-old boy, said B.C. Supreme Court Justice Sunni Stromberg-Stein in her sentencing ruling this past February.
In fact, the court heard Allen had sent 6,700 images of child pornography to an undercover officer, and an additional 840,000 images were seized when he was arrested in Vancouver.
The judge said Allen shared his vast collection of pornography on a peer-to-peer website.
The judge noted in some of Allen's on-line chats, he described himself as "pozzing," meaning someone with HIV who is actively trying to infect as many unsuspecting men as possible through unprotected sex.
Allen pleaded guilty and said he was remorseful, ashamed and embarrassed of the crimes.
The court also heard Allen had significant health issues, had been HIV positive for 23 years, experienced a bout of cancer in 2003 and had heart bypass surgery in 2004.
At the time of his arrest, he had been living on a disability pension since 2002 and admitted he was addicted to crystal meth for six years to help relieve pains related to his health conditions.
Allen began serving his sentence Jan. 20, 2012.