In both cases, you are paying for organised violence to enforce your socially-constructed monopoly rights to something.
In the case of real estate, your neighbours would probably do that for free, and for most of humanity's existence they did.
In the case of publicly-traded shares in the fruits of other people's expected future labour, enforcable only via a byzantine web of regulations and the unsleeping micromanagement by State bureaucracies... that is arguably far more worthy of taxing.
Its just that taxing unrealised gains is the same as taxing "the Emperor's new clothes". Price discovery by trading is asking that small child's opinion.
Its bad for "the System" and the parasites proposing it are fools, but I'm happy to watch them foot-gun.