I view Hamas like I do slaves that violently rebelled in the US. Though I don't relish or condone senseless atrocities, this does not invalidate the cause they are struggling against as the oppressed, similar to how abolition was still the right cause to support in fighting the system of chattel slavery in the USA regardless of individual acts of reprisals or killings that slaves engaged in.
I don't personally agree with the tactics of Hamas. Terrorism is a counter-productive tactic of desperation that undermines genuine revolution. But, they represent a form of opposition (albeit flawed) to an oppressor and I can understand how they resort to what they do out of desperation, and due to the extreme power imbalance between Palestinians and the US-backed Israeli military.
Hamas atrocities are not a reason to abandon a position of anti-imperialism and being opposed to apartheid and advocating for freedom for the occupied and oppressed Palestinian people who have been systematically deprived of their lands and forced into an increasingly untenable position.