Hamas isn’t a government, it’s a terrorist group. It’s also horrible to Palestinians and it undermines the actual government of Palestine, the Palestinian Authority.
The people of Gaza voted Hamas in, so Hamas is the actual government of Gaza. And also a terrorist organization.