Why not? If someone owes a bunch of taxes when they die, their estate should still be on the hook for it. I don't see any reason that money owed to the government should go to someone's heirs instead just because they happened to die at a specific time
but the money wasn't owed - because the gains were never realized, so the person (who died) never got to enjoy the consumption of that money, so therefore, it doesn't seem fair to take tax from somebody who would not be alive to defend themselves from it.
The heir receiving inheritance should get taxed - on the whole value (B in the OP's nomenclature). But the heir should not have to also pay B-A capital gains, which is a tax that would've been levied on the now dead, had they decided to sell instead of dying.
Why not? If someone owes a bunch of taxes when they die, their estate should still be on the hook for it. I don't see any reason that money owed to the government should go to someone's heirs instead just because they happened to die at a specific time