Why is gravity viewed as a curvature of spacetime and not the electromagnetic force? [duplicate]

There are four known forces in the universe. Two of these forces are the force of gravity and the force of electromagnetism. The first is the result of the mass of the object that has the gravity. The second is the result of charge in both the affected particle as well as the particles that generated the electrical and magnetic fields. Since both forces operate over spacetime why isn't there a model that common to both?

There is - gauge theory, and just as the Riemann tensor is the curvature of the Levi-Civita connection on the tangent bundle of spacetime, the electromagnetic field strength is the curvature of the gauge principal connection on a $\mathrm{U}(1)$-principal bundle over spacetime.