Investigators said the attacker admired Iran’s leadership and had no ties to a foreign terrorist organization.