Hamas was voted in 18 years ago with less than 45% of the vote on a platform of clean government and keeping peace with Israel based on the 1967 borders.
Hamas today is not the Hamas that was voted in, very few Palestinians alive today voted for them.