Herein, a 3D sponge-like polypyrrole/TiO2 (Ppy-TiO2) composite aerogel was developed for the first time to remove hydroxybenzotriazole (HOBt) from water. Mesoporous TiO2 was prepared via a sol–gel method, and then the Ppy-TiO2 composite hydrogel was prepared by oxidative polymerization and converted to aerogel by freeze-drying. The morphological, compositional, and surface characteristics of the prepared materials were detailly characterized. The characterization studies revealed that pure anatase mesoporous TiO2 nanoparticles were successfully prepared and incorporated into amorphous 3D Ppy with a porous chain-like network structure. Coupling Ppy and TiO2 extended the light absorption to the visible region and decreased the electron/hole recombination rate. The performance studies revealed that the Ppy-TiO2 composite has higher adsorption and photocatalytic activities than the sum of the individual components. Optimum performance was obtained at pH 5.3 using 0.25 g/L of the Ppy-TiO2 composite with a Ppy: TiO2 mass ratio of 1:1. The intermolecular hydrogen bonding was pivotal in the adsorption process which was multilayer. The degradation of HOBt occurs primarily by holes, then superoxide anion radicals. The total organic carbon (TOC) analysis showed a 90% reduction in carbon content after 30 min of treatment. The toxicity study indicated that the photocatalytic process decreased the toxicity of the HOBt solution. The synergism between adsorption and photocatalysis, easy separation, and reusability promote the application of Ppy-TiO2 composite aerogel for water treatment.