Have you read the Hamas Charter? It's been a while for me, I do need to brush up, but a reading may provide some useful context.
Their charter is not a document that gives other countries license to do what is being done.
It doesn't get more cut and dry than this.
For example, see: https://crimethinc.com/2023/10/17/from-the-galilee-to-gaza-a...