Why was Bartholomew Kuma after Luffy's head at the conclusion of the Thriller Bark arc? Why did Bartholomew Kuma want to take Luffy's head after the Thriller Bark Arc? Wasn't he a member of Revolutionary Army and secretly working for his father Dragon? If it wasn't for Zoro, Luffy would have died.
Bartholomew Kuma was a undercover member of revolutionary army, he cannot just say to the marines that he wont kill Luffy. Similarly, Straw Hat Pirates and Rolling Pirates (Lola's group of pirates) heard the order of the marines and Kuma can't just take a risk of blowing his own cover.

Hence he pretends to fight them all, since that also gives him a chance to check the loyalty of his crew and what are there potential.