Traditional IRA tax

Greetings,

I funded a Vanguard IRA in 2018 with after tax money (from savings) not realizing that I made too much money to take the $6500 deduction. In December of 2018 (I was 59 1/2 then) I took a distribution for the full amount and closed the account. My question is why am I getting taxed on this distribution on my tax return even though I funded the IRA with after tax money? Is there a way around this?

Thank you!