I tend to disagree with the board here. If the agent made good faith efforts for you all along and took time to show you multiple properties, helped negotiate and simply lost the sale(could be shenanigans that excluded you no fault of your agent) then it seems like a backhanded deal to and leave him out of the final sale. You can say that he had nothing to do with it but in reality he did. If there were 20 other properties looked at and not made a move on than that helped get you closer to the one you are finally buying.
If you don’t want to compensate him on this transaction, are you willing to accept a fair hourly rate and compensate him for the time he spent on the other properties. If total hours put in to previous transaction at an hourly rate of (XXX$’s) per hour is less than the commission would be on the purchase of this home than offer that. If on the other hand this would be less than do the right ting and give him his cut.