three-nation tour, Ahmadinejad called nuclear energy a "divine gift" providing affordable electricity.
"They accuse Iran, like all nations that seek to rapidly find their way out of the current domination," the Iranian leader said through an interpreter in a speech at a Benin university.
"We don't need an atomic bomb. And besides, it is not atomic bombs that threaten the world, but Western morals and culture declining in values."
Western powers suspect Tehran of covertly developing the capacity to produce a nuclear bomb.
Iran denies this and says its programme is for energy and medical purposes.
On Tuesday, Iran unveiled a new uranium production facility and two mines, only days after talks with world powers on its nuclear programme again ended in deadlock.
Ahmadinejad, who arrived in Benin on Sunday night, left Monday afternoon for neighbouring Niger, one of the world's top producers of uranium.
Iran needs uranium for its nuclear programme, and Niger has recently criticised a longstanding agreement with France - which gets most of its uranium from the former colony - demanding a bigger share of the profits from uranium ore mining.
Uranium from landlocked Niger is trucked to Benin ports for export, but Benin's foreign minister has insisted that uranium was not on the agenda for his Benin visit.
Talks in Benin focused particularly on energy, agriculture and education, Benin officials said.
Ahmadinejad will travel to Ghana on Tuesday following his visit to Niger for the final leg of the tour.
Speaking to journalists at the airport before his departure, Ahmadinejad said the uranium mines inaugurated last week in Iran should "be more than enough for the ambitions of my country."
During his speech at the university, Ahmadinejad condemned what he called colonialist thinking from wealthy nations that exploit poorer countries.
"Colonialist thinking has not yet disappeared," he said. "Only the method has changed, but the system is still there."
"To save their economy, they impose war everywhere to cover their failure, the failure of the capitalist system," said Ahmadinejad, who is due to leave office after June elections.
In Niger, the Iranian president's visit was being welcomed by those who said the impoverished country should search for new partners in the sale of its uranium.
"We must from now on adhere to policies in our own interests, in selling our uranium to who we want, including Iran," Nouhou Arzika, a prominent civil society activist in Niger, told AFP.
Niger's foreign minister visited Tehran in February. The African country is the world's fourth-largest producer of uranium.
The head of the student union at Niger's University of Niamey welcomed the Iranian leader's visit. The union previously organised a protest against French nuclear energy giant Areva.
"We are a sovereign state and will deal with who we want," Mahamadou Djibo Samaila told reporters.
"Our uranium, our oil, we are going to sell them to who we want."
Iran's relations with African countries have not always been smooth.
A diplomatic dispute hurt ties between Iran and Nigeria, Africa's most populous nation and largest oil producer, when weapons shipped from Iran were seized at a Lagos port in October 2010.
An alleged Iranian Revolutionary Guard member was accused of being one of the suspects behind the shipment, which Iran said was destined for Gambia, though Banjul denied being the intended recipient. The weapons had been labelled as building materials.