Retirement tax questions

The tax was paid out of my IRA account.   My question was, if I paid $10K in tax for $40K UBTI, I need to document that $40K is taxed money and I shouldn't have to pay tax on that much of money when it's time to withdraw in the future.   Is that not right?