The constant movement of loose electrical outlets can loosen the wires connected to the outlet and create dangerous arcing. Luckily, the fix is simple. If the outlet is recessed less than 1/4 in. in noncombustible material, you can fur it out with outlet shims as shown. If it's recessed more than 1/4 in., use a plastic extension ring. You'll find both in the electrical department at home centers.
Turn power off before doing this repair.