Charities obviously are not intended to give money to terrorists directly.
But, many charities are being used (either intentionally or not, from charity's employees' and donors' perspectives) by the terrorists.
Think of UNRWA for example, a UN agency and a relatively reputable charity for the Palestinians. Their facilities have been used numerously by Hamas to stockpile weapons, fire at the Israeli civilian populations, and all that even when children were present. See the UN report on this from one of the previous rounds of violence in the area. Obviously, the UN didn't build its schools to be used for launching missiles into the neighboring countries. But what can they do when Hamas comes and does that? Nothing.
In addition, keep in mind that the local government is a theocratic dictatorship, there's no freedom of press, no freedom of expression, no protection to whistleblowers, and very violent punishments for what may be considered as "cooperating with the occupation" (and that can include letting the Israelis and the world know when the charities are misused and abused by the militants).
As mentioned in the comments, Hamas itself may be considered a "charity" in some countries. In the Western world it is defined as a terrorist organization and cannot raise any funds. Any organization with direct links to it would also be disqualified once identified. That doesn't prevent them from trying and starting charities under various disguises which in reality launder money for the group. Those are usually identified and shut down quickly, so if you're donating to an established charity with a track record of >20 years (or solid independent auditing and supervision on the ground), you're probably fine.