A diet high in junk food can weaken the immune system by depriving the body of essential vitamins and minerals needed for immune function.