I'm a decade out of school but I think you can show that any theory that allows a massless spin-2 particle necessarily gives rise to gravity as a force. I remember seeing how this exact particle emerged when solving equations of motion for bosonic string theory and being pretty impressed (iirc it was a symmetric traceless rank 2 tensor field or something similar and the Prof had to handwave a bit on it being equivalent)
So maybe we have gravity simply because there are a lot of ways to construct a universe with it and only a few special cases without it.