“In one instance, about 20 militants dressed in black and with their faces covered brought six of the condemned men, their heads covered with cloth bags, to an alley near the Great Omari Mosque in Gaza City after midday prayers, witnesses said. A militant shot the men in the head one at a time with a pistol, after which he sprayed them with automatic rifle fire, the witnesses said. The bodies were loaded into government ambulances and taken away.”
That followed three previous executions carried out a day earlier. The killings followed Israel’s attack that killed three senior commanders of Hamas’s military wing after Hamas broke another ceasefire by shooting more rockets into Israel. It’s possible that one or more of those executed did provide information to Israel, but you can be sure that none of them received anything more than a summary trial after a brutal interrogation that would have made any man confess to something.
In any case Hamas considers the public demonstration to be more important than guilt or innocence. The public killings are intended to show anyone who dissents that they will suffer the same fate.