Actually, Mallory had no desire to off his employer.
He set the dynamite to the church because he thought the German and his men were Juan and company.
The real question is why would John want to kill Juan and his extended family?
The answer lies in the desert sequence that was cut from the final product.
Yeh, it took me a while to figure out that it was Juan and company that Mallory was trying to kill. It certainly would have helped if that had been more explicit, with or without the desert sequence.
It certainly doesn't help that it is sometimes, even to my English native speaker ear, difficult to understand what Coburn is saying. I think he's a great actor and I would not have wanted anyone else to play the role but his Irish accent sounds quite off to my, albeit non Irish, ear. It reminds me of him in the Great Escape where he again acts brilliantly but apparently his accent is meant to be Australian!