Hamas was never supposed to launch such attack on Israel, to be honest. Did they believe it would end up well for them and the people in the Gaza strip? If they thought so, then they are simply idiots. Specially since they aimed at civilians, they exchanged the future and the life of thousands of innocent people in order to brag for a successful and short attack in Israel territory.
To me, whoever was in charge of this attack had no sense of strategy or military actions in the long term. Unless Hamas expected Israel to get scared and surrender that attacked territory to Hamas? It would be pretty foolish to even consider that was a possibility. They have the support of USA...
Actually, Hamas has two leaders and they denied that they had such a plan to attack on that day and possibly done by individuals even without the approval of the one who is in authority or even if a planned attack still it can be a reason to kill civilians and how Israel and allies justifies their actions as they retaliate in no different way than a terrorist organization.
Even if they did not plan to attack on that day or in that specific manner, I have already seen a couple of videos from one of the billionaire leaders of Hamas (living comfortably in Qatar) saying that they are planing to continue with the violence and repeat what happened in that day over and over again, until the state of Israel cease to exist.
So even if they did not plan to do any of this, they seem to be very happy and showing much enthusiasm for it to continue to happen.
The saddest part behind the loss of civilian life is the fact there are footsoldiers willing to get themselves captured or shot at because of the will and whim of those people living as kings in Qatar, they do not even bother to get their hands dirty for the cause they alledgely support and fight for...