Among the known magnesium deficiency causes are prescription medications such as diuretics, antibiotics, painkillers and cortisone, which can deplete magnesium levels in the body by impairing absorption or by increasing excretion by the kidneys.