They get paid, you think they work for free? they get military aid by EU also. I mean even If @Asma was right what hell is Somalia going to give them in return?
You're right that they get paid by EU however, some of them want the natural resources. I remember reading an article years ago where the Ugandans expect preferential access/ or a cut once Somalia gets back on its feet. I'll try to find that article in the mean time but you already have KDF eating from the charcoal exports.
These guys are not benevolent at all. Ethiopia has no regards for the civilians when it gets engaged in a fire fight and AMISOM is irresponsible in road safety where they run over the civilians and even the SNA