This study investigated the fouling mechanism in pharmaceutical wastewater treatment by membrane distillation, with a focus on the interfacial electrokinetic effect between the membrane and foulants as well as the surface hydrophobicity effect, and an advanced in-situ optical coherence tomography (OCT) technology. Three antibiotics with different surface charges were used as feed solutions, consisting of cefotaxime (CTX, negatively charged), tobramycin (TOB, positively charged) and ciprofloxacin (CFX, neutral) for studying the interfacial electrokinetic effect. In order to study the influence of membrane hydrophobicity on the fouling process, two commercial membranes with different hydrophobicity were employed; commercial polyvinylidene fluoride (C-PVDF) and commercial polytetrafluoroethylene (C-PTFE). Additionally, we also fabricated a fouling resistant polyvinylidene fluoride (PVDF) membrane coated with perfluorooctyltriethoxysilane (FTES)-TiO2 nanoparticles to engineer the surface charge and energy, and to achieve a superhydrophobic surface. After the MD operation, OCT scans detected no visible foulant layer on the three negatively charged membranes when treating negatively charged CTX. On the other hand, in the case of positively charged TOB, the rejection efficiency was only 78% due to its accumulation behavior on the C-PVDF membrane surface, with a thick foulant layer (326–408 μm) and blockage of pores, while the TiO2-PVDF membrane exhibited a stable performance.