It is not BA that is denying boarding.
It is Border Force that is denying you from flying. Its Heathrow cock up since they run the security process but Heathrow are accountable to no one.
BA is liable for the actions and cock-ups it's service provider (in this case Heathrow Airport) is producing.
If the passengers had the right to enter (or remain if LHR was the starting point) in the UK from an immigration point of view, BA would owe them denied boarding compensation.
BA may try to get the money back from Heathrow Airport, but that's not the problem of the passengers affected.