Stealing your wealth no matter what

You buy bitcoin, price goes up, you sell the bitcoin for a profit. Government takes 30 or 40% of the profit through "realized gains tax". Since the whole point of investing in an asset like bitcoin is to prevent them from stealing your wealth via inflation of the fiat currency, it seems like "realized gains tax" is just the government saying "F*** you, we are going to steal your wealth no matter what."

I know there are loopholes that rich people with expensive lawyers can use to get around this stuff, so it's really only hitting the poor or those who are unknowledgeable.

Am I missing something here?