For the ideal gas it is easy to show that $1/T$ is an integrating factor, so
$$\delta Q/T = dS$$
is an exact differential.
So far I haven't found a convincing argument that this should apply in general? Can this be proven in general, or is it just an empirical fact that can only be explained satisfactorily from statistical theory?