Wrong. Hamas is the elected government of Gaza. Hamas formed a military, yea a shitty, poorly trained, and equipped one but they formed one. Hamas then invaded Israel, effectively declaring war on that state.
Israel responded to this invasion by launching an assault on Gaza with the intention of completely defeating Hamas and removing them as a threat. Hamas' military proved totally incapable of defending Gaza and is getting its collective ass stomped in the dirt. Along the way, the Palestinians living in Gaza are now subject to being caught in that war and suffering terribly--as defeated nations usually do--because of what Hamas, their elected government, decided stupidly to do to Israel.