Check the election stats, Hamas "won" but without any clear majority.
Moreover they won on the promise that they would seek a peaceful resolution with Isreal and they were (at that time) clearly the better of the only two realistic choices.
The Hamas of 2007 was not the Hamas of last year.