It started with outside interference. First the Russians, Yemeni and Ethiopians to set the stage for destabilization (Ogaden War). Now Gulf Arabs and Saudis are funding the group responsible for this (Al-Shabaab), and are keeping Somalia destabilized.
All that being said there's no excuse for murdering your own like this. Al-Shabaab is disgusting and a blight on the Somali people. But it's more complex than religion (not that it's helping), I say that as a former Muslim myself. Add corruption into the mix, with lack of education. Also people's livelihoods being tampered with (illegal fishing, and dumping in their waters) and the cycle continues.
Radicalism feeds off of ignorance. I hope Somalia becomes stable soon. It's a beautiful country with resources, and a strong-willed people.
RIP to the victims