In this paper a scheme is proposed for the purification of entangled states for two atoms trapped in two distant cavities via cavity decay. In the scheme, the atoms have no probability of being populated in the excited state and thus the atomic spontaneous emission is suppressed. This scheme is valid no matter when the cavity decay rate is larger or smaller than the effective atom-cavity coupling strength. The fidelity of the final state is not affected by the imperfection of the photodetectors.