I read some thread before that once you reached the legendary rank and you delete most of your posts but your activity will not be affected and you will remain as a legendary but I never thought that hero member has the same feature also or just a bug?

It's exactly this.
Furthermore, a quote from theymos confirms this:
IIRC only Newbie, Hero, and Legendary members don't get demoted normally. Maybe I'll fix it at some point, but it's not really a big deal.
I thought it's only on Legendary as I read it elsewhere for many times now. I just know today after reading your post that Hero Member was also invulnerable for demotion. Thanks for this info.
Maybe OP can locked this thread now.