If the High Sparrow condemned Cersei for his incestuous relationship with Jaime then how did he acknowledge King Tommen who was born from that relationship as a ruler?

How can he believe he is a Baratheon when he knows he's not? He clearly doesn't buy Cersei's denial of her relationship with Jaime. As smart as he is, he must know what that means to the kingdom and yet he seems to hold the king's rule sacred.