Hamas won the Palestinian legislative elections in 2006, and formed a unity government with Fatah. This unity government was dismissed by the Palestinian Authority's chairman and resulted in a de facto administration of Fatah in the West Bank and Hamas in Gaza. This puts their claim to legitimacy in perspective.
One does not have to belong to a party to signal ones agreement with its legitimacy and it's right to govern. No doubt there are many people in the UK who disagree with the current Conservative government, some more loudly and vociferously than others; but nevertheless, they will agree that they have a legitimate right to govern; no doubt, too, that Israel, given its historical enmity will insist on repeating that Hamas is merely a militant organisation; however, the Palestinian people regard them as their legitimate representative, if not their sole legitimate representative. It's also probably worth noting that in the context of the Palestinian situation, legitimacy is going to contested
I'm not sure then, that the question is well-founded; I mean in the sense of who exactly in the demonstration are members of Hamas; the demonstration was called in large part because of recent US policy moves to bolster Israels claim to Jerusalem and thus the demonstration is essentially an indication of the strength of Palestinian nationalism - and not a party political rally. It does not surprise me that Hamas has released no figures on the party political allegiance of those killed in the recent demonstrations. It seems irrelevant to the cause at hand.
edit
There's a report by Haaretz here reports that a senior Hamas official, Salah Albardaweel said that 'fifty of the 62 killed in Mondays bloody protest were Hamas activists'. This was from a videoed interview that was actually tweeted by the Israeli Defence Force. They also report that Islamic Jihad released a statement that three of those killed belonged to its military wing. They also branded Israels attempt to brand every protestor as a terrorist as 'pathetic'.
A more sceptical view is reported by the Electronic Intifada:
Several of those killed on Monday were buried in Hamas green flag, but not all. Fadi Abu Salmi, a double amputee, was shrouded with the flag of Islamic Jihad. Ahmad al-Adaini was buried in the flag of the leftist Popular Front for the Liberation of Palestine.
They add, that this point was also made by the veteran French-Israeli journalist Charles Enderlin:
"On the Palestinian side, Hamas is presenting itself as victorious, that is to say it had annexed the dead, who most overwhelmingly did not belong to Hamas. Moreover, we did not see many Hamas flags during these demonstrations.
So on the one hand we have Israel attempting to spin legitimate protests as a form of terrorism as they admitted in response to a petition by two Palestinian organisations to a high court:
Hamas has been leading a new tactic of terrorist activity under the cover of 'national commemoration events' and 'popular protests'.
Given this official view of the Israeli government, the massacre of protestors and demonstrators on Monday is not surprising. The affiliation of the most of the protestors to Hamas is mostly unsubstantiated and where substantiated showed that the affiliation was more or less negligible and mostly irrelevant. The interview by Albardaweel is admitted by the Electronic Intifada as a major PR coup for Israel but it's likely he was merely boasting on TV to the extent of Hamas influence and membership without realising - as he should have done being a spokesman for Hamas - how this would play out in the larger context.
This by the way is line with the analysis I presented above. I mean, that the affiliation of protestors to Hamas was irrelevant. The surprise here is that Hamas went ahead and released figures - with their experience of the media, and in particular, the Israeli media, especially on the ongoing climate of the 'war or terror', they should have known how this would have played into the hands of Israels PR machine.