In the present work, new biocomposite hydrogels were prepared based on the vinyl monomer 2-methacroyloxyethyltrimethyl ammonium chloride (ClAETA) in the presence of nanofibrillated cellulose (CNF) for the removal of the emerging contaminant nafcillin sodium monohydrate (NFX). The hydrogels were synthesized via free radicals, with the amount of CNF varied, and characterized by fourier transform infrared spectroscopy (FT-IR), thermal gravimetric analysis (TGA), and scanning electron microscope (SEM) techniques. The capacity to absorb water and to remove NFX was determined through batch studies. It was observed that the presence of CNF significantly promotes both properties, with a hydration capacity of 2100% and an NFX adsorption capacity of 45 mg g−1 in P(ClAETA)1-12-2%CNF (pH 6, 0.01 g of adsorbent, initial concentration of NFX 200 mg g−1). The conformational study showed that in the most stable conformation, CNF avoids direct interaction with the NFX molecule. Herein, the main interactions are predominantly dominated by weak interactions such as London dispersion and electrostatic interactions between charged groups. Molecular dynamics simulations distinguish the existence of π-π stacking interactions between aromatic rings from NFX in the polymer + NFX system. Contact interactions were qualitatively and quantitatively characterized by the NCI index and the IGM analysis.