We generalize a recently developed improved multicomponent pseudopotential lattice Boltzmann method in three dimensions and analyze its applicability to simulate flows through realistic porous media. The model is validated and characterized via benchmarks, and we investigate its performance by simulating the displacement of immiscible fluids in three-dimensional geometries. Two samples are considered, namely, a pack of spheres obtained numerically and a Bentheimer sandstone rock sample obtained experimentally. We show that with this model, it is possible to simulate realistic viscosity ratios, to tune surface tension independently, and, most importantly, to preserve the volume of trapped fluid. We also evaluate the computational performance of the model on the graphical processing unit and mention the implemented optimizations to increase the computational speed and reduce the memory requirements.