What’s the motivation for publishing the hash? Just pure flex?
Yes. For the linked Tweet above, someone literally challenged them and implied they were lying.
Yes. That's completely in line with his ego. There was at least one notorious instance in the past of "don't you know who I am".
https://imgur.com/did-not-expect-this-kind-of-attitude-from-...
shameless self-promotion
This has been a "tradition" for hackers for quite a while. It was/is especially common in the CTF-Community and vulnerability researcher scene, because you can claim knowledge of something, that will only become public later. Sometimes it's used to make sure you actually get the fame/payout/recognition you think you deserve in bug bounty-like schemes.