I doubt if Islam or any code of behavior, no matter how bizarre, had anything to do with it.
The al-Shabab militia wished to send the people a message 'Do not complain to anybody of any crimes by our members, or you will suffer for it.'
It was an act of oppression, pure and simple.