Struggling people are allowed to have, and share, enjoyable moments. Going through a divorce doesn't mean someone must be miserable 100% of the time, nor that you have to hate your spouse. Nobody is obligated to share the negative parts of their relationships and lives online, even if they're struggling.
Having a perfectly happy and problem-free marriage isn't a prerequisite for posting a happy family photo online with your kids. Nor should it be!
I don't understand why this is even a question. Just support your friend. Don't try to poke fun at the one moment of joy he shared online or call him out for some perceived discrepancy just because you know his struggles. It's not hypocritical for someone to have fun while going through tough times. It's bizarre that you'd even consider asking someone about this.