Ahmed Ali Alid, 45, told police after his arrest that the attack was “for the people of Gaza” and that if he had access to a machine gun he would have killed more people.