Beliefs profoundly affect people's lives, but their cognitive and neural pathways are poorly understood. Although previous research has identified the ventromedial prefrontal cortex (vmPFC) as critical to representing religious beliefs, the means by which vmPFC enables religious belief is uncertain. We hypothesized that the vmPFC represents diverse religious beliefs and that a vmPFC lesion would be associated with religious fundamentalism, or the narrowing of religious beliefs. To test this prediction, we assessed religious adherence with a widely-used religious fundamentalism scale in a large sample of 119 patients with penetrating traumatic brain injury (pTBI). If the vmPFC is crucial to modulating diverse personal religious beliefs, we predicted that pTBI patients with lesions to the vmPFC would exhibit greater fundamentalism, and that this would be modulated by cognitive flexibility and trait openness. Instead, we found that participants with dorsolateral prefrontal cortex (dlPFC) lesions have fundamentalist beliefs similar to patients with vmPFC lesions and that the effect of a dlPFC lesion on fundamentalism was significantly mediated by decreased cognitive flexibility and openness. These findings indicate that cognitive flexibility and openness are necessary for flexible and adaptive religious commitment, and that such diversity of religious thought is dependent on dlPFC functionality.