Security regulations require security staff to ensure that only authorised people are allowed airside - this includes passengers in possession of a valid boarding card. The latter can only be valid if the person holding it is the name on the card - hence the check of the photo id. At LGW you scan your boarding card but the security checks will vary depending on how much the staff are prepared to allow errors or not.