He viewed Somalia correctly as a Muslim country screwed over by external forces for geo-political reasons, and empathized with them.
Although i don't condone their actions (especially when it targets innocent people), terrorists are not as irrational as some would have you believe. The old canard of the random crazy terrorist is not a serious assessment, just a better way to continuing denying the merit and agent of certain grievances.
Especially when those grievances are the results of US foreign policy and admitting that would make America liable.
Terrorist, if anything, are not random, cowards, or illogical. A coward is someone who flies a nuclear bomb high in the sky and drops it on women and children at zero risk to himself. A coward gets 7 nations to attack one 3rd world country.
A coward is one that supports a neighboring enemy nation with drone coverage to invade a country with no military and dismantle a grassroots movement that was creating peace , justice and stability.
A coward hides behind White House walls while sending the poor to Vietnam to die. Terrorist, just like the crying of a baby , creates a desired effect. And from a social perspective it is always a sign of a society which has failed to represent, or incorporate plurality and marginalize groups.
One thing we can agree on, unlike most politicians, is their are no insincere or fickle suicide bombers.