Retirement tax questions

I am still confused.  I took out a loan from my 401K.  I understand that 401K monies were not taxed when put into the account.  The loan money was not taxed when I borrowed it.  If I pay the loan back with income money that has been taxed; what is the point of paying back the loan?  My thought is; I will be taxed on those same monies when they are distributed to me in retirement, thus being taxed on the same money twice.  I have not defaulted on the loan, and I still have 27 more months to pay, basically $22k.