The decoherence effect of spatial atomic dispersion on entangled states prepared between two non-interacting atoms that pass through a resonant electromagnetic cavity is studied in detail. Entanglement is shown to oscillate with the atom–field interaction time with an amplitude that decays due to inhomogeneous coupling strength. An upper bound for the entanglement that can be obtained using this procedure is introduced and evaluated numerically for different sets of system parameters. This magnitude depends solely on the overlap between atomic wavefunctions evolved according to two different atom–field interactions. Analytical expressions for the associated decay rate are obtained under different approximations.