Various water-based drilling fluids (WBDFs) are increasingly being used in oil and gas exploitation, for more environmentally acceptable and low-cost advantages than oil-based drilling fluids (OBDFs). However, WBDFs without an effective inhibitor easily facilitate shale swelling, hydration, and dispersion and even induce well instability, which is quite disadvantageous for well drilling. Thus, high-performance and environmentally friendly shale inhibitors are desperately needed for WBDFs, especially in deep and other challenging wells. Previously, gelatin was adopted as an environmentally friendly shale inhibitor in our group. However, the shale inhibition performance was limited at a high temperature. In this work, gelatin was further modified by 2,3-epoxypropyltrimethylammonium chloride (EPTAC, denoted as GT) to introduce quaternary amine functionalities and improve shale inhibition performance. The inhibitive property of GT was systematically evaluated through the linear swelling test, hot-rolling recovery test, and Na−bentonite (Na−BT) inhibition test. Results indicated that GT displayed better inhibition performance, especially at a high temperature, than pure gelatin and other common inhibitors. GT can be strongly adsorbed on the negatively charged clay surface via electrostatic attraction and hydrogen bonding, effectively decreasing the ζ potential of Na−BT particles and suppressing the double electrical layers. Meanwhile, GT effectively encapsulated and gathered the clay particles together, therefore preventing water ingress into clay and shale. GT showed great potential as a high-performance and environmentally friendly shale inhibitor for WBDFs.