This comment right here encapsulates a level of ignorance that is hard to believe.
So first, yes. Hamas does rule Gaza. They rule through fear and violence.
They were elected to power, but that was almost 20 years ago, and they ran on a platform of being moderate and peaceful. They barely won the election, and only because the other party was actively imploding.
Once they were in power, they quickly replaced anyone who could stand against them. This is still how they work when it comes to government services. They few that they do offer.
They've refused to hold elections or give up power in any way. And again, enforce their hold on power with violence.
Now, a bit over half of the population of Gaza are children. They were too young to have voted for Hamas.
In fact, the only reason why Hamas is in power at all, is actually Israel. See, the Israeli government has had a hand in Hamas since the beginning. They helped amplify the ultraconservative religious message of the founder of Hamas, all in an effort to weaken Palestinian solidarity. Netanyahu personally moved to prop up Hamas several times over the last 20 years, all in the name of keeping the Palestinians separate.
See, the West Bank has an actual, functional democratically elected government made up of Palestinians who are mostly secular. This is the "Palestinian government" that you seem to be alluding to.
They're in the West Bank under Israeli military occupation. They are literally not allowed to enter Gaza. No one has been allowed to freely enter or exit Gaza for decades. Israel has them under a full blockade.