Water can pass through the membrane freely while solute cannot. Bacteria infection could damage the cell that digest food and make it cannot be absorbed. When the food is not absorbed, some solute will be left in the intestine and make its osmotic pressure higher. Water is absorbed passively by osmosis in colon when all the food supposedly already digested and absorbed. Since the osmotic pressure is still high in colon, water couldn't be absorbed lead to diarrhea.