Hilchos Lashon Hara chapter 4, section 1
It is forbidden to say anything that would humiliate another Jew even if it is not spoken in his presence. And it is forbidden to demean him even if he saw him behaving improperly in his relationship with G-d. Although this friend didn’t behave properly towards G-d.