I am convinced the goal was to provoke a strong response from Israel. The reason is they knew the strong response from Israel would be disproportional and would damage relations between Israel and the rest of the ME.
Israel was approaching normalized relations with most of the major Arab nations around it, most importantly SA. Normalized relations with Israel would likely mean significantly less political and economical support coming to Hamas. Without outside resources Hamas is neutered.
So, seeing the real possibility of a large reduction in their economic and political power in the horizon they took desperate action to stop it, knowing full well the outcome.
We just had one!