They were called nebulae to distinguish them from stars. However, there are other extra-solar objects which are also extended on the sky: Planetary Nebulae, star clusters, super nova (SN for short, and SNe for the plural) remnants, for example. Since before the 1920s we didn't know the distance to those objects, it wasn't clear what were the relations between them. And so many of the catalogues of nebulae, for example Messier's catalogue (objects denoted by an `M' , like M31, which is Andromeda), or NGC (New General Catalogue, Dreyer 1888), contain a baffling variety of unrelated objects.
Immanual Kant, the German philosopher, suggested that the reason we see a faint band of stars across the night sky - usually called the Milky Way (MW for short) - is because most MW stars, as well as the Sun, lie in a disk. And so, when you look out at night in the plane of the disk, you see a faint band of light. Galileo already had resolved this band of light into stars. Kant claimed that most of the other nebulae were just other galaxies. It took until the 1920s before this hypothesis was proved correct. The historical introduction in BM is well worth reading.
As a final point: why study galaxies? Are they in some sense the most important building blocks in the Universe? I like BMs reasoning: stars are apparently huddled together in galaxies. And since (not surprisingly if you think about it) humans can see stars, we are naturally inclined to study them. But, for example, although a cluster of galaxies contains thousands of galaxies, they are by no means its main constituent. Most of the mass is in dark matter - which we cannot see at all. But most of the baryons are in hot gas, which we can observe with X-ray satellites, but we cannot see. And so the choice to study galaxies is a bit human centred: our eyes can see them.