On Scott Brison's point, if the donor is responsible for paying a tax on the donated asset, then in the vast majority of cases they're simply going to hold onto the asset. So the government is not going to get the capital gains tax revenue because the donors simply hold onto the asset, whereas if you remove the barrier to giving, they will donate the asset. So, effectively, the cost to the government is the charitable donation tax credit, similar to cash.
The government is giving up a foregone capital gains tax, but in reality it's sort of a discounted present value of a future capital gains tax. In the vast majority of cases, the individual would simply hold on to the asset rather than sell it.