He spoke at a Catholic shrine dedicated to Christians martyred for their faith in the 19th Century, on the second stage of his three-country Africa tour.
The Mass marks the 50th anniversary of the martyrs' canonisation.
After the mass he addressed thousands of young people, encouraging them to turn to their faith when faced with difficulties.
There were huge cheers as the Pope began the open-air ceremony at Namugongo, near the capital Kampala.
It was where many of the 45 Anglican and Catholic martyrs were burned alive.
Their execution was ordered by a king worried about the spread of Christianity.
Thousands of pilgrims braved rain to spend the night holding a vigil near the martyrs' shrines and there were long lines of pilgrims still trying to access the shrine as Pope Francis addressed the crowds on Saturday morning.
The Pope's five big issues in Africa
After the mass more than 150,000 young Ugandans gathered on the outskirts of Kampala for the Pope's other public event of the day.
Pope Francis urged them to use their faith to confront life's difficulties and turn negative experiences into strength.
Uganda is a deeply religious country, with over 14.1 million Catholics - and even adherents of other faiths will be paying close attention to the Pope's words, say correspondents.
He arrives here during the third week of a presidential campaign being fought by the country's ruler for the past 29 years, President Yoweri Museveni.
The Pope's message against corruption, and the need to care for the poor, is being welcomed by ordinary people here, in a place where some say corruption does much to damage the economy, and little to help people out of poverty.
Uganda ranks 142nd out of 175 countries on Transparency International's corruption perception index.
Gay rights activists in Uganda have expressed their disappointment that the Vatican did not respond to their request for a meeting with the Pope.
Openly gay Ugandans face many difficulties in everyday life, with many churches here preaching against homosexuality and encouraging homophobia. A Ugandan law, originally passed when the country was a British colony, still allows the authorities to pass a sentence of life imprisonment for gay people caught having sex.
There have been some critical references to the Pope's visit on Twitter - with some wondering "how many people have HIV today because contraception isn't allowed?" while others accused him of ignoring extreme anti-gay attitudes in Uganda.
On Friday, the Pope addressed an audience of young people in the Kenyan capital, Nairobi, urging them to unite and take a stand against the destructive effects of tribalism.
He will travel to the Central African Republic (CAR), which has been hit by serious violence between Christian and Muslim militias in recent years, on Sunday.
Religion in sub-Saharan Africa:
Profile: Pope Francis
Source: US-based Pew Research Center 2011 survey
Pope Francis has celebrated Mass in front of an audience of hundreds of thousands of Ugandan faithful.