It kind of does make sense in a twisted way.
They know how important the tourism industry is for Tunisia, so they attacked tourists.
They want Tunisia's economy to become weak, since these extremists have much more success in impoverished regions.
The goal of the extremists, is to turn everyone against each other. They want to turn non-Muslims against Muslims, and vice versa. That's why they are so eager to broadcast their ever more shocking actions to the rest of the world. That's why they shout the name of their God before every attack.
They want the world to see "Muslims did this", hoping that non-Muslims would react with persecution and discrimination against Muslims.
After that, they will turn around and way: "See? We were right all along".
And unfortunately, they seem to be winning. Tensions between Muslims and non-Muslims, Sunni and Shia, are increasing every day.
The cycle needs to stop, the world can't fall for their tricks. It is NOT Muslims vs non-Muslims, or Sunni vs Shia.
It is normal human beings (both Muslims and non-Muslims) united together, against the extremists. That's the only real solution.