There are two kinds of force fields in your circuit:
- The electrostatic field, due to the static charges accumulated in the
circuit, maintains and smooths out the currents in all parts of the
circuit. This field is conservative, i.e. if we move a unit charge
around the circuit, the net work done by the electrostatic field is
equal to zero.
- The chemical force field, that exists only inside the battery and
supplies the energy to the charges moving in the circuit. The
chemical forces are a result od complex molecular interactions, that
take place inside the battery. This field is not conservative.
If we consider a perfect battery, with zero internal resistance, the net force acting on the charges inside it must be equal to zero (otherwise, we would get infinite current). Thus, inside the battery, the electric field acts in the direction opposite to the current.
Going back to your question, in the integral we account only for the electic field inside the circuit and in this case, the electric field is conservative and the integral is equal to zero.
On the other hand, if you used a generator, instead of the battery, the electric field inside the circuit would no longer be conservative. In this case, you get two contributions to the electric field:
- Electrostatic contribution from the static charges accumulated in the circuit, as mentioned above.
- Electrodynamic contribution, induced by the change of flux in the generator.
We need to include both contributions when calculating the integral. In this case, the integral is not equal to zero, but this is what we expect, because there is a changing flux, inside the generator.
There is a small subtlety in the above argument. The molecular interactions, responsible for the chemical forces are in fact electromagnetic in nature. Hence, one may ask, why they are not included in the integral. The answer is: The equations that we use to describe electrical circuits contain macroscopic fields i.e. fields that are averaged over small regions of space. The molecular fields, responsible for the chemical forces are averaged to zero by this procedure and hence need not be included in the integral.
This answer is based on the 7.1.2 from Gryffiths, 'Introduction to Electrodynamics.' You may find it helpful, to consult this textbook for more detailed description.