The reasoning is simple; bring attention to the cause, disrupt any peace talks between Palestine and Israel, and gain respect in the world for successfully taking on the super power.
In effect, posturing. Bloody, but nonetheless the same.
If, and this is a big if, it turns out to be who is suspected, then there is a good chance the U.S. will be provoked to action. If the U.S. is not careful how it acts, sides will be taken. What the Palestinians want is a united Arab front against Israel. America has long convinced Israel it is in their best interests to control their retaliation against Palestinians. Will the U.S. now be able to call for restraint now that the attacks are on U.S. soil?
There are those factions that would welcome all-out war in the middle east. Forcing the American hand might be one way to bring it about. For now, it looks as though that was unsuccessful. Too many countries, Arab countries included, have come out publicly against the attack. This is a good sign. Still, the U.S. will have to avenge themselves somehow, either legally or militarily, or they will encourage other countries to attack.