Inspect the socket with a magnifier since a piece of lint may be covering some of the pins. The pins may need to be cleaned with alcohol applied to a DIMM or a piece of cardboard the same thickness as a DIMM and inserted and removed several times.
Occasionally a socket pin is bent out of shape only slightly and can be bent back with a dental pick, not just by pulling it but by pushing it from inside the hole behind the affected pin.
Replacing the socket requires special equipment or solder that melts at under 60C.
There are similar motherboards but based on the G41 chipset instead of the G31, but some require DDR3 rather than DDR2.