Magnesium and its alloys are not normally used as bioresorbable temporary implants due to their high and uncontrolled degradation rate in a physiological liquid environment. The improvement of corrosion resistance to simulated body fluids (SBF) of a magnesium alloy (AZ31) coated with poly-β-hydroxybutyrate (PHB) was investigated. Scanning electron microscopy, Fourier transform infrared spectrometer, and contact angle measurements were used to characterize surface morphology, material composition, and wettability, respectively. pH modification of the SBF corroding medium, mass of Mg2+ ions released, weight loss of the samples exposed to the SBF solution, and electrochemical experiments were used to describe the corrosion process and its kinetics. The material’s biocompatibility was described by evaluating the effect of corrosion by products collected in the SBF equilibrating solution on hemolysis ratio, cytotoxicity, nitric oxide (NO), and total antioxidant capacity (T-AOC). The results showed that the PHB coating can diffusively control the degradation rate of magnesium alloy, improving its biocompatibility: the hemolysis rate of materials was lower than 5%, while in vitro human umbilical vein endothelial cell (HUVEC) compatibility experiments showed that PHB-coated Mg alloy promoted cell proliferation and had no effect on the NO content and that the T-AOC was enhanced compared with the normal group and bare AZ31 alloy. PHB-coated AZ31 magnesium alloy extraction fluids have a less toxic behavior due to the lower concentration of corrosion byproducts deriving from the diffusion control exerted by the PHB coating films both from the metal surface to the solution and vice versa. These findings provide more reference value for the selection of such systems as tunable bioresorbable prosthetic materials.