A lawful permanent resident, holding a green card, cannot be deported simply for voicing pro-Hamas sentiments at a protest, so long as his expression remains within the realm of protected speech and does not cross into conduct deemed criminal or in violation of immigration law. The First Amendment, after all, does not apply only to the likable, the respectable, or the politically palatable; it extends even to those whose views are detested by the majority. However, the moment speech becomes something more--if he were to provide funding, shelter a combatant, or in any way offer material support to Hamas, which the United States classifies as a foreign terrorist organization, he would have stepped into the territory of deportable offenses.
The law is precise in its distinctions, and mere protest, however distasteful to some, does not meet the threshold. Only if his words incite violence in a legally actionable way, if he encourages specific acts of terrorism, or if he participates in a riot or criminal activity, could his residency be called into question. But absent those factors, his green card remains secure, his status unchanged, and his right to express even the most loathsome views remains intact, however much it may disturb the sensibilities of the state.