It has recently been suggested that EinsteinRosen (ER) bridges can be interpreted as maximally entangled states of two black holes that form a complex EinsteinPodolsky-Rosen (EPR) pair. This relationship has been dubbed as the ER = EPR correlation. In this work, we consider the latter conjecture in the context of quadratic Palatini theory. An important result, which stems from the underlying assumptions as regards the geometry on which the theory is constructed, is the fact that all the charged solutions of the quadratic Palatini theory possess a wormhole structure. Our results show that spacetime may have a foamlike microstructure with wormholes generated by fluctuations of the quantum vacuum. This involves the spontaneous creation/annihilation of entangled particle-antiparticle pairs, existing in a maximally entangled state connected by a nontraversable wormhole. Since the particles are produced from the vacuum and therefore exist in a singlet state, they are necessarily entangled with one another. This gives further support to the ER = EPR claim.