What can the total stellar mass of galaxies tell us?
Actually, the light of most galaxies is dominated by red giants, which are predominantly not very massive stars (more massive than the Sun sure, but less than a few solar masses). These are much more common than short-lived high mass stars, which in any case don't exist in many galaxies (e.g. old ellipticals).

In galaxies that not gas-rich - again most ellipticals, the stars form most of the baryonic mass and most of the stellar mass is in low-mass stars. Even in galaxies where there is lots of gas (the dust is a negligible mass component), there are ways of measuring this too. Estimating the total mass of baryonic versus dark matter is essential in understanding the formation and evolution of galaxies, since they behave differently.

Stars less massive than about 0.9 solar masses have had insufficient time to evolve. The baryonic mass in these stars is locked away and cannot be recycled into other stars. Knowing the fraction of mass in this situation is important in understanding the chemical evolution of galaxies.