It paid very little Corporation Tax because it gave huge bonuses to its staff. How is this tax avoidance? It shared its profits with its staff, so that it didn't have any left afterwards. I don't have all the facts, and I can't tell if it got its profits down using tax-approved share schemes (that's what the tax approval is for!), but I can't see the problem.
Facebook’s UK division paid just over £4,000 in corporation tax last year, almost £1,000 less than the average British worker pays in income tax and national insurance contributions.