Calculating entropy change of surroundings
When you evaluate the change in entropy of an entity (in this case the surroundings) between an initial and final (equilibrium state), you separate that entity from everything else, and then you only look at how that entity has changed between the two states, disregarding the actual process path.  In the case of the surroundings (treated as an infinite reservoir), it had received a certain amount of heat between the initial and final states, and its internal energy and entropy increased as a result.  In the formalism of thermodynamics, changes in an  ideal infinite reservoir are always regarded as taking place reversibly, irrespective of other irreversibilities in the actual process.  So if the actual process is irreversible, the irreversibility (entropy generation) is all considered to take place in the system, rather than in the surroundings (in the case of an ideal infinite reservoir).

You may also find my response in the following link pertinent to this question:  Thermodynamics entropy and temperature