The global area cultivated with oil palm has doubled in the past two decades, causing deforestation, land-use change, freshwater pollution, and species loss in tropical ecosystems worldwide. Despite the palm-oil industry been linked to severe deterioration of freshwater ecosystems, most studies have focused on terrestrial environments, while freshwaters have been significantly less studied. We evaluated these impacts by contrasting freshwater macroinvertebrate communities and habitat conditions in 19 streams from primary forests (7), grazing lands (6), and oil palm plantations (6). In each stream, we measured environmental characteristics, e.g., habitat composition, canopy cover, substrate, water temperature, and water quality; and we identified and quantified the assemblage of macroinvertebrates. Streams in oil palm plantations lacking riparian forest strips showed warmer and more variable temperatures, higher turbidity, lower silica content, and poorer macroinvertebrate taxon richness than primary forests. Grazing lands showed higher conductivity and temperature, and lower dissolved oxygen and macroinvertebrate taxon richness than primary forests. In contrast, streams in oil palm plantations that conserved a riparian forest, showed a substrate composition, temperature, and canopy cover more similar to the ones in primary forests. These habitat improvements by riparian forests in the plantations increased macroinvertebrate taxon richness and maintained a community resembling more the one in primary forests. Therefore, the conversion of grazing lands (instead of primary forests) to oil palm plantations can increase freshwater taxon richness only if riparian native forests are safeguarded.