In this case L is not constant. Its magnitude is, but its direction isn't: it's precessing.
Torque is the derivative of angular momentum with respect to time, so if you know the precession rate, you have a constraint on the torque acting on the planet: the magnitude of the torque must be a constant times the magnitude of the planet's angular momentum, and the precession rate tells you what that constant must be. The torque is a result of the sun's gravity acting on the planet's oblateness, which has a spectrum of spherical harmonics, the great majority of which is J2. That oblateness can be (and has been!) measured very accurately via radiometric tracking of many spacecraft, and the sun's gravity field is very well known, so the magnitude and direction of the torque can be calculated. This leaves the magnitude of the angular momentum vector as the only unknown in the equations, so it is also determined. Radiometric tracking also determined the mass of the planet as well as its shape, so that combination: mass, shape (which is very nearly spherical), and angular momentum; gives the moment of inertia.
Various laboratory measurements of the equations of state of materials such as iron-nickel mixtures, silicate minerals, etc. (sometimes needing some extrapolations or assumptions) provide constraints for models of the interior mass distribution, such as size and density of a core, to give that moment of inertia. The models must also agree with the planet's total mass. If a model gives the wrong result for the inertial moment and/or total mass, the model must be tweaked, or even completely revamped. Eventually you converge on a model (or a set of related models) that is consistent with the inertial moment, the planet's total mass, and the distribution and equations of state of all the constituents.
Seismic data are a great accompaniment to the gravity science. The parameters describing acoustic wave propagation do have elements of mass density in them, but they also have parameters independent of mass density (such as the character of intermolecular forces that yield acoustic velocity), so the seismic data are not redundant with gravity data. Notably, they can unambiguously determine the locations of interfaces in the planet's interior, such as a core-mantle boundary or a liquid-core/solid-core boundary, via phenomena such as acoustic impedance contrasts or mode-conversion characteristics. Mode conversion has to do with propagating longitudinal waves, which can propagate through solids, liquid, and gases, and propagating transverse (shear) waves, which can only propagate in solids. Any time one of these waves impinges at a non-perpendicular angle on a partially-reflecting surface, part of the reflected wave is in the same mode (longitudinal or transverse) as the incoming wave, but some is converted to the other. The character of the materials on either side of the surface determines how much is reflected and how much is transmitted, and how much mode conversion occurs. Since transverse acoustic waves can't propagate in a liquid they are very useful in finding solid/liquid interfaces. When seismic data set the locations of major boundaries, like crust/mantle and mantle/core, gravity modelers can use those data to tweak their models and infer things like bulk densities, so they're no longer dependent on extrapolated equations of state or assumed ratios of constituents.
I'm very optimistic that the soon-to-be-launched INSIGHT mission to Mars will begin the fascinating seismic exploration that Viking failed to do. After that—probably long after that!—seismic exploration of Venus should be equally fascinating, at least to planetary scientists.
@Prakhar , if you're looking for the full-up (and rather lengthy) discussion of the non-symmetrical solution (i.e., the inertial moment tensor is not a diagonal matrix), then this treatment from a graduate-level Cornell University course might help: http://astro.cornell.edu/academics/courses/astro6570/Precession_Free_and_Forced.pdf .