If you close a CD, you pay taxes on just the interest. You've already paid tax on the principal amount. If you would pay an early withdrawl penalty, that is deductible.
For an investment, you are only taxed upon your profits. Thus, for a CD, you will have to pay taxes on the interest, but not the principal. This tax is paid at the much more favorable capital gains rate, as well.