Say you bought the painting for $10k, then the artist becomes world famous and the price really does rise to $1m. Are you going to donate the painting if doing so would trigger a ~$150k capital gains tax bill? Nope. At least if you sold it you have the proceeds to cover the taxes.