Ocean acidification (OA) and antibiotic pollution pose severe threats to the fitness of keystone species in marine ecosystems. However, the combined effects of OA and antibiotic pollution on the intestinal microbiota of marine organisms are still not well known. In this study, we exposed the herbivorous gastropod Trochus niloticus, a keystone species to maintains the stability of coral reef ecosystems, to acidic seawater (pH 7.6) and/or sulfamethoxazole (SMX, 100 ng/L, 1000 ng/L) for 28 days and determined their impacts on (1) the accumulation of SMX in the intestine of T. niloticus; (2) the characteristics of the intestinal microbiota in T. niloticus; (3) the relative abundances of sulfonamide resistance genes (i.e., sul1 and sul2) and intI1 in the intestinal microbiota of T. niloticus. Our results show that OA exposure leads to dramatic microbiota dysbiosis in the intestine of T. niloticus, including changes in bacterial community diversity and structure, decreased abundances of dominant species, existences of characteristic taxa, and altered functional predictions. In addition, SMX exposure at environmentally relevant concentrations had little effect on the intestinal microbiota of T. niloticus, whether in isolation or in combination with OA. However, after exposure to the higher SMX concentration (1000 ng/L), the accumulation of SMX in the intestine of T. niloticus could induce an increase in the copies of sul2 in the intestinal microbiota. These results suggest that the intestinal health of T. niloticus might be affected by OA and SMX, which might lead to fitness loss of the keystone species in coral reef ecosystems.