It's because those two things are very different. When you give away your resources to a charitable cause you are producing a benefit to society. An inheritance goes directly to private individuals and does not produce the same societal benefit.
It's also common to see charitable donations as being a kind of optional tax (both are a person spending their resources for the benefit of society, rather than themselves). In this vein, it doesn't make sense to tax them because you are basically taxing taxes.
There are a litany of different views from the political thought side. Here are a few interesting ones. This is by no means comprehensive, but the question didn't specify what kind of perspective you wanted.
Marxists on Inheritance Taxes
Although I don't know of a case where Marx specifically discussed these kinds of taxes, there is plenty of Marxist writing about estate taxes. In this view, inheritance is a social problem: the wealthy pass on their wealth to their children, perpetuating the enslavement of the workers. The poor have no wealth to pass on, which means their children will also likely be poor. Another angle is that inheritance often passes on the means of production (business ownership, valuable industrial/commercial equipment, etc.) which is especially important when talking about perpetuating this problem.
Marxists advocate for a high inheritance tax to reduce this problem. Sometimes they suggest values as high as 100% on private (but not usually personal) property.
To read more: google "marx estate tax". You will find thousands of articles.
Carnegie and Tocqueville on Non-Profits
Pluralist thought usually thinks of non-profit organizations as providing social services that the government doesn't. Donations are effectively someone wanting to pay more in taxes than they are.
One example: de Tocqueville's "Democracy in America" describes the role of civic associations in America. This article discusses his book in a fairly typical fashion. The basic gist is that since volunteering (either labor or financial resources) provides a benefit to society, it doesn't need to be taxed. It contains this great quote from a non-profit executive:
When we as individuals, however, volunteer our hard-earned dollars to advance society by freely giving from our own pockets, government taxes us less. The government gives us a tax deduction. As a matter of public policy, the law of the land rewards us for taking a personal role in the advancement of society. We are able to give less to Caesar when we give more to others.
Another famous iteration of this idea was in Carnegie's "Gospel of Wealth". Carnegie espoused the idea that the rich have a responsibility to use their wealth for the advancement of society. When you give your wealth to your own family upon your death, it means primarily two things: you failed to use it to advance society (because you still had it) and you failed to find a productive use for it (because it only benefited your family).
Carnegie doesn't connect this to tax policy. But if you accept his arguments and you wonder how to encourage charitable spending and discourage inheritances than of course you increase the estate tax rate and decrease taxes on charitable donations.