Sometimes physicians lie to third-party payers in order to grant their patients treatment they would otherwise not receive. This strategy, commonly known as gaming the system, is generally condemned for three reasons. First, it may hurt the patient for the sake of whom gaming was intended. Second, it may hurt other patients. Third, it offends contractual and distributive justice. Hence, gaming is considered to be immoral behavior. This article is an attempt to show that, on the contrary, gaming may sometimes be a physician's duty. Under specific circumstances, gaming may be necessary from the viewpoint of the internal morality of medicine. Moreover, the objections against gaming are examples of what we call the idealistic fallacy, that is, the fallacy of passing judgments in a nonideal world according to ideal standards. Hence, the objections are inconclusive. Gaming is sometimes justified, and may even be required in the name of beneficence.