Didn't Denzel tell Will Smith not to kiss a dude in "Six Degrees of Separation"?
Anyways Denzel is big enough that he doesn't need to do that. So he WANTED to.
My understanding of what he said was (paraphrasing): "Don't do it unless you're willing to do it right."
Will's issue within the movie was that he (as an actor) didn't want to commit to the kiss. So he eventually agreed to a "peck", but he's said that because he wasn't 100 percent comfortable with it, he always felt like it read as insincere in the movie (I couldn't say, because I've never really sat down and watched it).
So Denzel's advice wasn't so much never ever do it. It was, "If you're going to do it , then do it. If you're going to half-ass it, then don't bother."
Denzel apparently decided it was relevant for the part and his character, so he did it. Sounds like they chickened out about leaving in the film like he said. Or they just decided to save that for the Director's Cut. Special Edition, Gold Star Blu-Ray whatever the fuck they'll call trying to milk a few extra million out of the movie this time around.