A molecularly imprinted polymer (MIP) for the diuretic drug hydrochlorothiazide (HCTZ) based on theoretical predictions was developed. Molecular modeling calculations were performed to study the intermolecular interactions in the pre-polymerization mixture and to select a suitable functional monomer and a porogenic solvent for the synthesis of the MIP. To confirm the results of the theoretical predictions, three MIPs were synthesized and evaluated using the equilibrium batch rebinding method. A water-compatible MIP was prepared using HCTZ as the template and acrylamide as the functional monomer (FM) with ethylene glycol dimethacrylate as the cross-linker and tetrahydrofuran as the porogen. An imprinting factor of 8.24 was obtained. The polymer was characterized by Fourier transform infrared (FTIR), solid-state nuclear magnetic resonance, scanning electron microscopy, thermogravimetric analysis and nitrogen sorption porosimetry. In addition to HCTZ, six structurally related compounds were tested to evaluate the selectivity of the HCTZ-MIP, and cross-selectivity of the MIP was verified.