The regulated and targeted administration of hydrophobic and hydrophilic drugs is both promising and challenging in the field of drug delivery. Developing a hydrogel which is responsive to dual stimuli is considered a promising and exciting research area of study. In this work, melamine functionalized poly-N-isopropyl acrylamide-co-glycidyl methacrylate copolymer has been developed by copolymerizing glycidyl methacrylate (GMA) monomer with N-isopropyl acrylamide (NIPAm) and further functionalized with melamine units (pNIPAm-co-pGMA-Mela). The prepared pNIPAm-co-pGMA-Mela copolymer hydrogel was characterized using various characterization techniques, including 1H NMR, FTIR, SEM, zeta potential, and particle size analysis. A hydrophobic drug (ibuprofen, Ibu) and hydrophilic drug (5-fluorouracil, 5-Fu) were selected as model drugs. Dual pH and temperature stimuli-responsive drug release behavior of the pNIPAm-co-pGMA-Mela hydrogel was evaluated under different pH (pH 7.4 and 4.0) and temperature (25 °C, 37 °C, and 45 °C) conditions. Furthermore, the in vitro biocompatibility of the developed pNIPAm-co-pGMA-Mela copolymer hydrogel was determined on MDA-MB-231 cells. The pH and temperature-responsive drug delivery study results reveal that the pNIPAm-co-pGMA-Mela hydrogel system is responsive to both pH and temperature stimuli and exhibits about ~100% of Ibu and 5-Fu, respectively, released at pH 4.0/45 °C. Moreover, the MTT assay and hemocompatibility analysis results proved that the pNIPAm-co-pGMA-Mela hydrogel system is biocompatible and hemocompatible, suggesting that that it could be used for drug delivery applications. The experimental results suggest that the proposed pNIPAm-co-pGMA-Mela hydrogel system is responsive to dual pH and temperature stimuli, and could be a promising drug carrier system for both hydrophilic and hydrophobic drug delivery applications.