Mr Mogae, who heads the Botswana government-backed Aids Council, said it was difficult to promote safe sex when the two practices were illegal.
He also called for condoms to be distributed in prisons.
His views are controversial as many conservative Batswana frown upon homosexuality and prostitution.
Botswana has one of the highest HIV/Aids rates in the world – 17% of the population is HIV positive.
A government spokesman on HIV/Aids told the BBC homosexuality and prostitution would remain illlegal until the government concluded wide-ranging consultations to see whether there was a need to change the law.
Mr Mogae said Botswana could not regard homosexuals – a tiny minority in the country – as criminals.
"I don’t understand it [homosexuality]. I am a heterosexual," he told the BBC’s Network Africa programme.
"I look at women. I don’t look at other men. But there are men who look at other men. These are citizens."
He said the government also needed to change its policy towards sex workers to help curb HIV/Aids.
"To protect them and their clients from being infected, you have to assist them to protect themselves. I don’t think by arresting them you help them," Mr Mogae said.
He said the government’s failure to give prisoners’ condoms was worsening the HIV/Aids pandemic.
"If people can go to prison HIV negative and come out of it HIV positive, it means that prisons, whatever the law says, are one of the sources of infection," the former president told Network Africa.
Mr Mogae stepped down as president in 2008 at the end of his two terms in office.
In the same year, he was awarded the Mo Ibrahim prize for good governance in Africa.
When he announced the winner, ex-UN head Kofi Annan commended Mr Mogae for taking strong action to tackle HIV/Aids.
During his rule, Botswana became the first sub-Saharan African country where anti-retroviral drugs were widely available for free.