The term "atomic weight" is a historical artifact that dates back to the early development of atomic theory. When the concept of atomic weights was first introduced, it was believed that these weights represented the relative heaviness or mass of atoms compared to a reference atom.
At the time, the distinction between weight and mass was not well understood, and the terms were often used interchangeably. The concept of mass as a fundamental property of matter was not fully established until later with the development of Newtonian mechanics and the understanding of gravitational forces.
However, as our understanding of physics progressed, it became clear that the atomic weight is actually a measure of the average mass of atoms in a sample relative to the mass of an atom of a specific isotope used as a reference. The atomic mass unit (amu) is now the preferred unit to express atomic weights, and it is defined based on the mass of a specific isotope of carbon, carbon-12.
So, while the term "atomic weight" may be somewhat misleading in the context of modern physics, it has persisted due to historical reasons. In recent years, there has been a shift towards using the term "atomic mass" instead of "atomic weight" to better align with the concept of mass in physics.