Retirement tax questions

I requested an old employer retirement account to be closed out to roll over into my IRA. When I received the my 1099-R it was listed as code 8 distribution although they deposited it directly into my IRA. Am I at least able to write off the IRA contribution? I don't understand why I am being taxed on money that never ended in my pockets, but is rather caged away in my IRA.