For starters, the money you take out of a traditional 401(k) is pre-tax, but when you pay it back it will be with money you already have paid tax on. Then, years down the line, when you withdraw the money in retirement you’ll owe tax again. I think paying tax once is plenty.
You also lose out on the compounding of that money. Just think about folks who pulled money out of their 401(k) in late 2008 and early 2009: That’s money that wasn’t invested when the stock market staged its epic rally beginning in March 2009. Lastly, there’s the risk that if you are laid off, or just choose to switch jobs, you typically must repay the loan within a few months. Fail to do that and the loan is treated like an early withdrawal; tax is due and if you’re under age 55 you will owe a 10 percent penalty as well.