I missed this BBC item:
Ugandan troops make up the bulk of the African Union force helping Somalia's UN-backed government. With much of the country under the control of al-Shabab Islamist militants, it is probably one of the most dangerous missions that a soldier could embark on. So why are Ugandans choosing to take part?
Leaving aside politics for their government:
For an individual soldier, the financial incentive to fight in Somalia is clear. The lowest paid Ugandan soldiers earn around $120 (£76) per month; if they opt to fight in Somalia they earn more than $1,000.
Citing a Ugandan journalist another answer:
Uganda has never had a peaceful transition of power. Guns and soldiers have always been involved in a change of regime.

"The ruling NRM party does not want thousands of soldiers hanging around in barracks with time on their hands. And there is no work for them outside the army - unemployment is 50% here," he says.

"President Museveni has been in power for almost 26 years and his popularity is waning. Military officers are already getting restless. From the government's point of view, better for them to be fighting in Somalia.
Link:http://www.bbc.co.uk/news/world-africa-16853499