If heat flow into the surrounding (i.e. when a reaction is exothermic) the random motion of the molecules in the surroundings increase. Thus the entropy of the surroundings increases. The second law of the thermodynamics states that the total entropy of the universe always increases for a spontaneous process.