why does somebody have to go and do that to innocent people

There are multiple reasons. First of all, terrorist organizations such as the ISIS are able to recruit new radicals mostly through attacks such as this one. Staying in the media limelight is another reason. Also, the terror groups receive a lot of donations from similar minded individuals after each of these attacks.