In a 5-to-4 decision, the court said only people who had suffered “concrete harm” from being associated with terrorism had the right to sue.