Photon-Mediated Entanglement Of Electron Spins In A Dynamic Solid-State Environment