Most were probably government/UN or NGO charity workers.
The article says that the American had moved there with his wife to run an orphanage. I doubt that it was for the UN. He was probably a Christian.
Regardless of why they were there, they had every right to be there and not to be killed. Just like the people of Paris had every right to go to a nightclub without being killed.
Islamic terrorism is the problem, not where people choose to go, and in any case, Islamic terrorism can come looking for you no matter where you are, including right at home.