Because I think some people will ask such questions in good faith, I'll try to answer. Ultimately, Allah knows best. I'm not a scholar, just a flawed and grieving person typing out thoughts on the internet, and probably not presenting them anywhere near eloquently enough to do the complexity of it all justice.
Islam teaches that this life, this Dunya, is not all that there is, and people will then be accountable for their actions in this life when they stand before Allah. Everyone who murdered and raped an innocent person will be held accountable for that in the next life. We are all accountable for our choices and our actions. There are many examples throughout history of people doing things which are ethically and legally wrong and presenting it to themselves and others as being in the name of a religion or cause; saying something was done in a religion or cause's name does not exempt the person from having made a conscious decision to carry out those acts. In Islam, a mentally competent person who has attained adulthood/legal maturity in relation to whatever the action is question may be, is responsible for their own choices and will face the consequences in the next life. Rape and murder, torture and abuse of innocents are not acceptable in Islam, and that doesn't change regardless of how much propaganda or manipulation people might try to deploy. Perpetrators of those acts will, I believe, face very severe punishment.
Why does Allah/God allow such bad things to happen - this is a question asked by people of many faiths when confronted by the darkest elements of humanity, time and again. I'm sure many scholars of Islam, Judaism and Christianity have contemplated it and explained it far better than I ever can, and it's something that I think many people of faith struggle with. There is a tale in Surah Al-Kahf that describes how what even the wisest of humans cannot see as Allah does. We can only see to the horizon, but Allah knows everything that has been, that is and that will be. It is taught that Allah does not allow anything to be lost or taken from someone without writing something better for that person in their future, in this life or the next.
As people in Palestine and Israel bury their dead, wait for their loved ones and seek answers, questions of Why has Allah/Gd allowed this to happen will be being asked by genuinely heartbroken souls, and I hope people can find comfort and answers from people far more knowledgeable than I am. I'm still asking that question myself, at times - when I look at the ruins of buildings and lives and efforts for peace, when I hear news of people in Palestine and Israel about whom I'm worrying, when I comfort grieving friends, when I (as someone who knows what it is to bury a child) see that pain in the eyes of a father or mother... I don't know why this is happening, only Allah/God knows. What I believe is that He has a plan, that He knows everything and nothing can be hidden from Him, and that His justice means innocent people will find comfort in the next life. Those who have died, their hardships in this life are over and they will not suffer any more. It's the rest of us who now have to face our own struggles of continuing in this life without them. To us, it feels like a lifetime before we can be with them again, but to them it will be moments and then they are with us again in a far better place than this one.