L 98-59 (TIC 307210830, TOI-175) is a nearby M3 dwarf around which TESS revealed three small transiting planets (0.80, 1.35, 1.57 Earth radii) in a compact configuration with orbital periods shorter than 7.5 days. Here we aim to measure the masses of the known transiting planets in this system using precise radial velocity (RV) measurements taken with the HARPS spectrograph. We considered both trained and untrained Gaussian process regression models of stellar activity, which are modeled simultaneously with the planetary signals. Our RV analysis was then supplemented with dynamical simulations to provide strong constraints on the planets' orbital eccentricities by requiring long-term stability. We measure the planet masses of the two outermost planets to be 2.42+/-0.35 and 2.31+/-0.46 Earth masses, which confirms the bulk terrestrial composition of the former and eludes to a significant radius fraction in an extended gaseous envelope for the latter. We are able to place an upper limit on the mass of the smallest, innermost planet of <1.01 Earth masses with 95% confidence. Our RV plus dynamical stability analysis places strong constraints on the orbital eccentricities and reveals that each planet's orbit likely has e<0.1. L 98-59 is likely a compact system of two rocky planets plus a third outer planet with a lower bulk density possibly indicative of the planet having retained a modest atmosphere. The system offers a unique laboratory for studies of planet formation, dynamical stability, and comparative atmospheric planetology as the two outer planets are attractive targets for atmospheric characterization through transmission spectroscopy. Continued RV monitoring will help refine the characterization of the innermost planet and potentially reveal additional planets in the system at wider separations.