Donating appreciated assets is a good way to avoid capital gains tax if you want to donate anyway, but the sum of the capital gains tax avoided and the tax deduction you get for the donation (which is based on the current value of the asset at time of donation) is still less than if you'd sold the asset for that value and kept what was left over after paying the taxes.
To put it another way, it's not true that donating puts you in a better financial position than not donating. It is true that you can do a lot more good to someone you're giving to per dollar it costs you to do so if you are careful about how you go about it.
This of course ignores fraud scenarios, where someone appraises the donation at more than the asset is actually worth, but that's a general problem which is not particular to the whole capital gains saving aspect.