It is not just the compensation that discourages physicians, especially internists and pediatricians, from working for the government (eg Medicare, Medicaid). A major issue is the paperwork burden. The government paperwork requires a specialized back office staff which only large practices can afford.
A recent sample of the bureaucratic mess doctors are supposed to figure out. A Medicare billing error is a potential felony, even if inadvertent.